The Artima Developer Community
Sponsored Link

.NET Buzz Forum
The dynamic SQL discussion is a must read

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Roy Osherove

Posts: 1807
Nickname: royo
Registered: Sep, 2003

Roy Osherove is a .Net consultant based in Israel
The dynamic SQL discussion is a must read Posted: Nov 18, 2003 3:49 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Roy Osherove.
Original Post: The dynamic SQL discussion is a must read
Feed Title: ISerializable
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/rosherove/Rss.aspx
Feed Description: Roy Osherove's persistent thoughts
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Roy Osherove
Latest Posts From ISerializable

Advertisement
There's one of those “holy wars” going on in the blogsphere. This time it is about the using Dynamic SQL vs. Stored procedures. But this holy war is an important one. It's one that I have learned a lot from, and I'll admit it shamelessly. I didn't know all those good things about Dynamic SQL. I really didn't I guess it's that kid of experience that you can learn form others who have done a great deal more than you in that area, and I am not a database guru by all means.
I did have the misconception that dynamic SQL is bad and that stored procedures are the cure(albeit painful at times) to the ills of SQL injection and program maintenance.
Rob howard started it (oh god that sounds awful) and got lots of very insightful comments (read them). Then Frans Bouma followed with a scathing and to the point response and these have been other responses in the blogsphere. Then Rob answerd back to Frans . I urge you to read the whole discussion, as it is enlightening.
 
I always thought of dynamic SQL as a plague because I only knew the “bad”way of doing it: concatenating strings into WHERE clauses. I admit that I was not aware of the possibility to use  sp_executesql and actually creating parameters in the strings passed. That makes the whole situations different when I think of it. You should read the discussion mainly because if there's one thing to “get” from all this is that there is no silver bullet. There are pros and cons for each way of doing things, but you need to have both of these tools on your belt. I really regret not having exposed myself to this earlier.
 
A very nice article that explains the dynamic SQL approach is found here and here is the blog that points to it which contains some time comparisons of these approaches(via Rob howard).
 
Ah.. I fulfilled my mantra for today: “Finish the day with at least one thing you did not know before it started”

Read: The dynamic SQL discussion is a must read

Topic: Why are typed data tables columns declared "internal"? Previous Topic   Next Topic Topic: Distributing ASP.NET Whidbey Applications/Controls

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use