Tuesday, August 28, 2007

Hip-hip...Aaaaaarrrraaaaayyyyy!!

There is simply nothing more fulfilling and gratifying in the world of software development than solving a tough problem with an elegant, robust and scaleable solution.

Welllll...except for googling your problem, standing on the shoulders of other programming geniuses, and using their elegant, robust, and scaleable solutions to solve your own tough problem. Programmers are inherently lazy and I'm no exception. So when I stumbled onto this little URL gem describing an elegant, scaleable, robust and plug-n-play-like method to providing integer array parameters to a SQL stored procedure; I thought I'd share it with my fellow engineers.

I'd be interested to see the performance variance in high volume queries (like say oh, 40,000 records) between utilizing this method as compared with just providing a giant string delimited varchar parameter, concatenating, and executing it.

2 comments:

appwiz said...

Pretty... but unmaintanable. Six months from now, you'll look at that code and wonder why you did it that way. Besides, having to pass THAT MUCH DATA into a stored procedure should immediately get you to focus on the app design.

Tracy said...

I concur and I like this method much better: Passing Lists to SQL Server 2005 with XML parameters.
I just hope it's SQL Server 2000 friendly.