General information
Forum:
Microsoft SQL Server
Title:
Use variabe as table name
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only