- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
The great thing about anecdotal evidence is that it is so convincing!
Admin
Its not all about performance.
The main difference is in permissions.
If you use dynamic SQL the user will require select permisssion on the tables as opposed to controlling just exec perm on the SP.
Some of our clients only allow SP execution for applications so dynamic SQL is not an option without a strong business case.
In this case if you allow dynamic SQL all you will get is the same messy IFs out in the application anyway.
Admin
In Oracle, it's the owner of a stored procedure who needs the right to access a table; the user who calls that procedure doesn't need any privileges on that table, just the right to execute the procedure. Dynamic SQL doesn't behave differently in that respect, but you need to be carefull anyway, because if the procedure doesn't care about SQL injection attacks, other users (who have the right to call the procedure) might be able to do evil things within the security context of the owner of the procedure.