Click here to Skip to main content
15,888,610 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: More Stored Procedure Nonsense Pin
Dave Kreskowiak29-Nov-13 4:45
mveDave Kreskowiak29-Nov-13 4:45 
GeneralRe: More Stored Procedure Nonsense Pin
Sentenryu29-Nov-13 6:15
Sentenryu29-Nov-13 6:15 
GeneralRe: More Stored Procedure Nonsense Pin
Rob Grainger28-Nov-13 22:50
Rob Grainger28-Nov-13 22:50 
GeneralStored Procedure Hell Pin
Rob Grainger28-Nov-13 4:16
Rob Grainger28-Nov-13 4:16 
GeneralRe: Stored Procedure Hell Pin
Nicholas Marty28-Nov-13 4:41
professionalNicholas Marty28-Nov-13 4:41 
GeneralRe: Stored Procedure Hell Pin
Max Methot28-Nov-13 4:55
Max Methot28-Nov-13 4:55 
GeneralRe: Stored Procedure Hell Pin
Rob Grainger28-Nov-13 9:37
Rob Grainger28-Nov-13 9:37 
GeneralRe: Stored Procedure Hell Pin
Rob Grainger28-Nov-13 9:48
Rob Grainger28-Nov-13 9:48 
Actually, the little bit I looked at today had rafts of queries of the form..

SQL
INSERT INTO TEMPTABLE (A, B, C, D, 'OBJ TYPE 1')
SELECT A, B, C, D
FROM MASTERTABLE 
WHERE OBJTYPE = 1   ' OBJ TYPE 1

INSERT INTO TEMPTABLE (A, B, C, D, 'OBJ TYPE 2')
SELECT A, B, C, D
FROM MASTERTABLE 
WHERE OBJTYPE = 2   ' OBJ TYPE 2


(without the comment. Theres absolutely zero comments)

Rinse and repeat for a further 13 object types, then apply a set of 15 update queries to the result based on other selections based on the same types. If I ever have to get my hands dirty, I'll begin by refactoring those out to other procedures, and use a parameter to specify the object type - that's if I can't do the same thing more efficiently by GROUP BY in some way. Hopefully after a while some wood will begin to emerge from the trees.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.

GeneralRe: Stored Procedure Hell Pin
Nagy Vilmos28-Nov-13 6:03
professionalNagy Vilmos28-Nov-13 6:03 
GeneralRe: Stored Procedure Hell Pin
Rob Grainger28-Nov-13 9:50
Rob Grainger28-Nov-13 9:50 
GeneralRe: Stored Procedure Hell Pin
Vasudevan Deepak Kumar29-Nov-13 1:56
Vasudevan Deepak Kumar29-Nov-13 1:56 
GeneralRe: Stored Procedure Hell Pin
Tim Carmichael28-Nov-13 5:05
Tim Carmichael28-Nov-13 5:05 
GeneralRe: Stored Procedure Hell Pin
Sentenryu28-Nov-13 5:09
Sentenryu28-Nov-13 5:09 
GeneralRe: Stored Procedure Hell Pin
Rob Grainger28-Nov-13 9:52
Rob Grainger28-Nov-13 9:52 
GeneralRe: Stored Procedure Hell Pin
Jörgen Andersson28-Nov-13 12:16
professionalJörgen Andersson28-Nov-13 12:16 
GeneralRe: Stored Procedure Hell Pin
Rob Grainger28-Nov-13 22:19
Rob Grainger28-Nov-13 22:19 
GeneralRe: Stored Procedure Hell Pin
Rob Grainger28-Nov-13 9:41
Rob Grainger28-Nov-13 9:41 
GeneralRe: Stored Procedure Hell Pin
Nicholas Marty28-Nov-13 21:56
professionalNicholas Marty28-Nov-13 21:56 
GeneralConvert.ToInt32 Pin
Silvabolt27-Nov-13 7:29
Silvabolt27-Nov-13 7:29 
GeneralRe: Convert.ToInt32 PinPopular
Ron Beyer27-Nov-13 7:58
professionalRon Beyer27-Nov-13 7:58 
GeneralRe: Convert.ToInt32 Pin
Silvabolt27-Nov-13 8:09
Silvabolt27-Nov-13 8:09 
GeneralRe: Convert.ToInt32 Pin
Ron Beyer27-Nov-13 8:23
professionalRon Beyer27-Nov-13 8:23 
GeneralRe: Convert.ToInt32 Pin
krumia27-Nov-13 17:00
krumia27-Nov-13 17:00 
GeneralRe: Convert.ToInt32 Pin
Ron Beyer27-Nov-13 17:41
professionalRon Beyer27-Nov-13 17:41 
GeneralRe: Convert.ToInt32 Pin
Richard Deeming28-Nov-13 1:11
mveRichard Deeming28-Nov-13 1:11 

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.