|
Posted by Erland Sommarskog on 12/06/05 00:11
A few more thoughts. If searches like your first example are common, it
may be a good idea to make an optimization so that you only run query
in this case. Of course this adds to the complexity to your code.
And, I am not sure that a stored procedure is the best thing to package
this, particularly not if you will try to make shortcuts. It's probably
better to generate the queries from a client language. Of course, on
SQL 2005, you could do this from a CLR stored procedure.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|