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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-04-20 : 09:58:58
|
| Tim writes "I have a set of Archives and want to pass a variable to the name of a table How can I make this workas in we are in month 4 so it makesArchive_pagelog_4hereis what i have so farCREATE PROCEDURE ArchivePageLog(@Job_id int,@month char(2))ASSET NOCOUNT ONBEGIN TRANSACTIONINSERT INTO Archive_pagelog_ + @month SELECT * FROM pagelog WHERE Job_id = @job_id" |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-04-20 : 10:49:40
|
| EXEC ('INSERT INTO Archive_pagelog_' + @month + ' SELECT * FROM pagelog WHERE Job_id = ' + LTRIM(STR(@job_id, 8))Duane. |
 |
|
|
|
|
|