Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use variabe as table name
Message
From
20/09/2004 16:24:57
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Use variabe as table name
Miscellaneous
Thread ID:
00944216
Message ID:
00944216
Views:
56
I like to create a table having name related to the created day. For example,
its name will be Survey20040920 if it is created today. Is it possible?

I used following SQL, but it didn't work.


Declare @Surveyfilename varchar(50)
set @Surveyfilename= 'Survey'+CONVERT(char(8), getdate(), 112)

select * into @Surveyfilename FROM [Survey]


Thanks


Jim
Next
Reply
Map
View

Click here to load this message in the networking platform