You are here: Re: Create Table with Variable included in Table Name « MsSQL Server « IT news, forums, messages
Re: Create Table with Variable included in Table Name

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация