|
Posted by Erland Sommarskog on 11/24/06 22:47
Hugo Kornelis (hugo@perFact.REMOVETHIS.info.INVALID) writes:
> To your question: if you need to return different sets of columns under
> different circumstances, I'd use different stored procedures for each
> result set. The use of dynamic SQL as in your example has some downsides
> and some risks that you should avoid if at all possible.
Personnally, I agree with the idea of keeping it all in the same
procedure. Splitting it up over several, increases the risk that the
the branches one day deviates from each other when they shouldn't.
--
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
Navigation:
[Reply to this message]
|