June 24, 2011 at 2:10 pm
It's late on Friday.....drawing a blank....
How can I get a 4part name into a variable to use for an insert statement?
If x
Insert into db.dbo.table (Local sql server)
select a, b, c from table, join, table, blah
If y (Remote sql server)
insert into server.db.dbo.table
select a, b, c from table, join, table, blah
Is there a way to put the server, db, dbo, table into a variable & use the variable in the insert statement?
thx
June 24, 2011 at 2:17 pm
You wold need to use dynamic SQL for such a requirement.
June 24, 2011 at 2:38 pm
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply