Posted by Erland Sommarskog on 01/30/08 22:44
Chris H (chollstein@broadreachpartnersinc.com) writes:
> I am trying to create a routine for generating tables from a master
> response table. The end result would increment the variable
> "somevalue" by one and then create the next table (ie: TESTTEST2). Is
> there a way to insert the variable into the Table Name as well as one
> or more of the Field Names within the table? I've tried some
> different syntax variations and haven't hit on the right combo yet!
You can read here how to do to it - and why you probably shouldn't.
http://www.sommarskog.se/dynamic_sql.html.
--
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]
|