Posted by Erland Sommarskog on 06/07/05 02:17
[posted and mailed]
andrew (acoles@gmail.com) writes:
> My question therefore is does anyone know either
>
> (1) a way I can pass a variable (n) to these SELECT n PERCENT
> statements
Use SQL 2005. :-)
Dynamic SQL is probably the way to go, but there are a couple of
caveats. Before you start to use dynamic SQL all over town, you
might want to learn more about it. I have an article on my web site
about it: http://www.sommarskog.se/dynamic_sql.html.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
[Back to original message]
|