Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
shebert
Yak Posting Veteran
85 Posts |
Posted - 2004-06-22 : 15:02:05
|
I am building a stored procedure this is getting passes a variable table name I.E. (MyTable_34567) into @variableTable where 34567 is going to change every time the Proc. is called by the application.The Proc must Create a table named MyTable_34567 and give attributes like TableId int identity, name varchar(100) for example.is there any way to do this inside the stored procedure beside Dynamic SQLdeclare @sql varchar(1000)select @sql ='create table'select @sql= @sql+ @variableTable+ ' (tableId int identity, name varchar(100)'exec(@sql)I beleive dynamic SQL will slow Porc. down and ths Proc. is going to be a biggie.Any help you can think ofThanks Steve" |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-06-22 : 15:03:41
|
Your only option is dynamic sql.Tara |
|
|
shebert
Yak Posting Veteran
85 Posts |
Posted - 2004-06-22 : 15:06:12
|
I was afraid of that Thanks |
|
|
|
|
|