Worst code I've written in a while

Posted by merrillaldrich on SQL Blog See other posts from SQL Blog or by merrillaldrich
Published on Thu, 20 May 2010 17:44:00 GMT Indexed on 2010/05/20 18:02 UTC
Read the original article Hit count: 283

Filed under:
Here's a nice, compact bit of WTF-ery I had to write for a prod issue today: Again: UPDATE TOP ( 1 ) dbo . someTable SET field3 = 'NEW' WHERE field2 = 'NEW' AND field3 = '' IF @@ROWCOUNT > 0 GOTO Again Can you guess from the code what awesomesauce issues I was working around? This was a reminder for me that sometimes there is time to do it right, but sometimes you just have to do it now. I need that lesson sometimes, as I tend to be a perfectionist. If you are trying to do it right , please don't...(read more)

© SQL Blog or respective owner