SQL Server Stored Procedure - TechRepublic
General discussion
April 23, 2001 at 12:53 AM
todd parker

SQL Server Stored Procedure

by todd parker . Updated 25 years, 2 months ago

How can you place a variable in the TableName of a CREATE TABLE SQL Statement inside a stored procedure? Because just declaring a varchar doesn’t seem to do the trick…

For instance;

DECLARE @MyTable varchar(20)

BEGIN
Code that puts string into @MyTable
END

BEGIN
Create Table @MyTable (blah blah)
END

Thanks,
-Parker

This discussion is locked

All Comments