Re: Alternative to Dynamic SQL?
- From: sqlguru@xxxxxxxx
- Date: Sat, 30 May 2009 15:51:17 -0700 (PDT)
The argument of SQL injection is invalid now because using command
parameters is a standard. I actually read your article on dynamic
search querying using stored procedure and found it invalid. It's a
huge maintenance hassel because search requirements often change and
is prone to "runtime" issues if you fail to test properly. You also
use sp_executesql to execute a dynamically built SQL inside a stored
procedure (you might as well do it in the application layer because it
gets cached either way)!
On May 30, 5:55 pm, Erland Sommarskog <esq...@xxxxxxxxxxxxx> wrote:
(sqlg...@xxxxxxxx) writes:
The best solution is to use dynamic SQL. There isn't any problems with
dynamic SQL, modern database engines actually cache dynamic sql and
benchmarks show that there isn't any real differences between SP's and
dynamic SQL.
Oh, if life was that easy! There are plenty of possibilities to wreck a
server with dynamic SQL if you do it wrong. Used right and with care, it
is a tremendous asset.
--
Erland Sommarskog, SQL Server MVP, esq...@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: Alternative to Dynamic SQL?
- From: Michael Coles
- Re: Alternative to Dynamic SQL?
- From: Erland Sommarskog
- Re: Alternative to Dynamic SQL?
- References:
- Alternative to Dynamic SQL?
- From: SQL
- Re: Alternative to Dynamic SQL?
- From: --CELKO--
- Re: Alternative to Dynamic SQL?
- From: sqlguru
- Re: Alternative to Dynamic SQL?
- From: Erland Sommarskog
- Alternative to Dynamic SQL?
- Prev by Date: Re: Alternative to Dynamic SQL?
- Next by Date: Re: setup & sql server express
- Previous by thread: Re: Alternative to Dynamic SQL?
- Next by thread: Re: Alternative to Dynamic SQL?
- Index(es):
Relevant Pages
|
Loading