Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamically Assign Table Name
Message
 
 
À
08/07/2002 08:31:41
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00676071
Message ID:
00676085
Vues:
17
>Hi,
>
>I would like to dynamically create a table in a stored procedure based on a value that I have stored in a variable..
>

Here's a sample code that creates table in the current DB.
declare @TableName varchar(32)
SET @TableName = 'TestTable'
EXECUTE('CREATE TABLE ' + @TableName + 
	' (field1 char(3), field2 int)')
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform