Click here to Skip to main content
15,891,687 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: Days Of Week Pin
phil.o3-Dec-13 1:56
professionalphil.o3-Dec-13 1:56 
GeneralRe: Days Of Week Pin
Mohamad M. Mohamad3-Dec-13 3:04
Mohamad M. Mohamad3-Dec-13 3:04 
GeneralRe: Days Of Week Pin
phil.o3-Dec-13 3:13
professionalphil.o3-Dec-13 3:13 
GeneralRe: Days Of Week Pin
Marco Bertschi3-Dec-13 1:53
protectorMarco Bertschi3-Dec-13 1:53 
GeneralRe: Days Of Week Pin
phil.o3-Dec-13 1:55
professionalphil.o3-Dec-13 1:55 
GeneralMessage Closed Pin
10-Dec-13 7:32
User 113800010-Dec-13 7:32 
GeneralRe: Days Of Week Pin
Marco Bertschi10-Dec-13 7:55
protectorMarco Bertschi10-Dec-13 7:55 
GeneralMore Stored Procedure Nonsense Pin
_Maxxx_28-Nov-13 13:37
professional_Maxxx_28-Nov-13 13:37 
The post below reminded me of an instance a few years ago.

Existing database, mainframe system, all working well. I was a short term contractor.

Sales chap from "a reporting tool" company had been in and shown the MD and sales manager the wonderful real-time data their product could present them - lovely graphs and charts etc.

Of course, he showed them on his local database on his laptop.

Having bought the software, they employed me to implement the changes necessary to their database in order to use this new, magic, tool.

Performance-wise it wasn't possible for the tool to query the existing database, so a form of data warehouse was necessary. It was decided that an overnight process would update the data warehouse, rather than real-time updating, as the transaction volume was high enough that benchmarking showed a potential significant decrease in overall performance.

So no real-time reporting - but the MD was happy that yesterday's data would be up-to-date enough.

So (with guidance from the reporting company) I developed a bunch of stored procedures to run overnight to collate the day's transactions into a format acceptable by the tool. And let me tell you, the tool was very fussy about its data types; e.g. if you wanted to summarise by date, then the date column had to be a date column in a specific format - preferably text in yyyymmdd format - with no time component. Any codes to be summarised on also had to be specific formats (I don't recall exactly, but from memory, numerics needed to be in text fields, right justified with leading spaces)

So I spent a few weeks writing and tweaking stored procs.

First live run on a day's transactions to about 25 hours to run.

Not so good.

Optimisation and more tweaking - fastest we got it down to was about 15 hours - which meant if we kicked it off bang on 5pm it might be ready for the MD in the morning.

Unfortunately, when we pointed the reporting tool at it, it just sat there. We never saw any results from the full data warehouse - the tool just appeared to hang.

In the end, we had to create a summary database and a 'this week' database just for the tool to be able to display anything, and the MD had to print stuff out so he could compare week by week.
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011

.\\axxx
(That's an 'M')

GeneralRe: More Stored Procedure Nonsense Pin
Jörgen Andersson28-Nov-13 20:44
professionalJörgen Andersson28-Nov-13 20:44 
GeneralRe: More Stored Procedure Nonsense Pin
_Maxxx_29-Nov-13 0:13
professional_Maxxx_29-Nov-13 0:13 
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 
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 

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.