Click here to Skip to main content
15,896,915 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: How do you like your nulls Pin
Jibesh12-Dec-12 22:35
professionalJibesh12-Dec-12 22:35 
GeneralRe: How do you like your nulls Pin
RafagaX13-Dec-12 4:30
professionalRafagaX13-Dec-12 4:30 
GeneralRe: How do you like your nulls Pin
AspDotNetDev10-Dec-12 6:35
protectorAspDotNetDev10-Dec-12 6:35 
JokeRe: How do you like your nulls Pin
Brisingr Aerowing10-Dec-12 9:18
professionalBrisingr Aerowing10-Dec-12 9:18 
GeneralRe: How do you like your nulls Pin
Florin Jurcovici11-Dec-12 10:18
Florin Jurcovici11-Dec-12 10:18 
GeneralCount the horrors Pin
Jörgen Andersson6-Dec-12 22:37
professionalJörgen Andersson6-Dec-12 22:37 
GeneralRe: Count the horrors Pin
OriginalGriff8-Dec-12 4:38
mveOriginalGriff8-Dec-12 4:38 
GeneralQ: What is the sound of one value coalescing? Pin
PIEBALDconsult6-Dec-12 8:04
mvePIEBALDconsult6-Dec-12 8:04 
A: It goes BOOM!

<context>SQL Server 2008 R2

I was just altering some of my code to choose betewen two values via COALESCE. Then I decided I might want to back out the change, but I wanted to leave the existing code in case I wanted to reapply the change later. So I had something like COALESCE ( /* X , */ Y ) Z -- of course, it makes no sense to COALESCE on one value, but I was only going to leave it there momentarily and I don't mind causing errors in order to advance my knowledge of the syntax.

The result is Incorrect syntax near ')'. -- I thought that was an odd message.
I checked the documentation: COALESCE ( expression [ ,...n ] ) -- so the syntax should be legal! WTF | :WTF:
But it also goes on to say that COALESCE is equivalent to a CASE and my attempts at
CASE (WHEN Y IS NOT NULL) THEN Y END Z
CASE ELSE Y END Z
have been unsatisfactory. Sigh | :sigh:
General42 Pin
AspDotNetDev5-Dec-12 13:45
protectorAspDotNetDev5-Dec-12 13:45 
QuestionRe: 42 Pin
Brisingr Aerowing5-Dec-12 14:27
professionalBrisingr Aerowing5-Dec-12 14:27 
GeneralRe: 42 Pin
PIEBALDconsult5-Dec-12 15:13
mvePIEBALDconsult5-Dec-12 15:13 
GeneralRe: 42 Pin
Adam R Harris11-Dec-12 10:13
Adam R Harris11-Dec-12 10:13 
GeneralWould you like to buy an IsNull ? Pin
PIEBALDconsult5-Dec-12 8:04
mvePIEBALDconsult5-Dec-12 8:04 
GeneralRe: Would you like to buy an IsNull ? Pin
dan!sh 5-Dec-12 8:22
professional dan!sh 5-Dec-12 8:22 
GeneralRe: Would you like to buy an IsNull ? Pin
PIEBALDconsult5-Dec-12 9:31
mvePIEBALDconsult5-Dec-12 9:31 
GeneralRe: Would you like to buy an IsNull ? Pin
AspDotNetDev5-Dec-12 10:07
protectorAspDotNetDev5-Dec-12 10:07 
GeneralRe: Would you like to buy an IsNull ? Pin
PIEBALDconsult5-Dec-12 12:10
mvePIEBALDconsult5-Dec-12 12:10 
GeneralRe: Would you like to buy an IsNull ? Pin
dan!sh 5-Dec-12 21:06
professional dan!sh 5-Dec-12 21:06 
GeneralRe: Would you like to buy an IsNull ? Pin
KP Lee5-Dec-12 12:36
KP Lee5-Dec-12 12:36 
GeneralRe: Would you like to buy an IsNull ? Pin
PIEBALDconsult5-Dec-12 13:11
mvePIEBALDconsult5-Dec-12 13:11 
GeneralRe: Would you like to buy an IsNull ? Pin
Jörgen Andersson6-Dec-12 21:12
professionalJörgen Andersson6-Dec-12 21:12 
GeneralWhy do engineers insist on complexity? Pin
Joe Woodbury4-Dec-12 7:33
professionalJoe Woodbury4-Dec-12 7:33 
GeneralRe: Why do engineers insist on complexity? Pin
Andrew Rissing4-Dec-12 8:11
Andrew Rissing4-Dec-12 8:11 
JokeRe: Why do engineers insist on complexity? Pin
Brisingr Aerowing4-Dec-12 8:12
professionalBrisingr Aerowing4-Dec-12 8:12 
GeneralRe: Why do engineers insist on complexity? Pin
Chris Meech4-Dec-12 9:10
Chris Meech4-Dec-12 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.