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 |
|
asarak
Starting Member
36 Posts |
Posted - 2006-08-09 : 05:25:27
|
| Hi guys, i have a question i try to create a table dynamically, with the following ...declare @a varchar(20)set @a='tbl_'+convert(varchar(15),getdate(),105)select @acreate table @a (i int, b char(10))gothat is obvious uncorrect, is there any idea how to create this?? The purpose is to create dynamically a table and store some datadaily in different tables....thanks a lotregardsASARAK |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-08-09 : 05:35:58
|
| [code]declare @a varchar(20)Declare @QryString varchar(800)set @a='tbl_'+convert(varchar(15),getdate(),105)Set @QryString = 'Create Table ' + @a + '(i int, b Char(10))'exec(@QryString)Set @QryString = 'Select * From ' + @aexec(@QryString)[/code]Chirag |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|