June 18, 2009 at 3:56 am
how can we insert rows from a table XYZ of one database to another database table XYZ
June 18, 2009 at 4:21 am
shanila_minnu (6/18/2009)
insert into table1(col1,col2,col3)
select col1, col2, col3 from server2.database2.owner2.table2
You'll need to create linked server before doing that.
use sp_linkedserver 'other_server_name'
June 19, 2009 at 6:13 am
You could also use OpenRowSet without creating a linked server, I believe. Or SSIS.
There are plenty of methods available. The question is, what tools does your workplace have available for your use?
June 19, 2009 at 6:15 am
heh... there is no need to create linked server... OP wants data to access from other database and not other server.
This should do fine if db is present in same server..
insert into table1(col1,col2,col3)
select col1, col2, col3 from database2.owner2.table2
or as Brandy said, openrowset query...
June 19, 2009 at 7:09 am
June 19, 2009 at 8:42 am
ps (6/19/2009)
heh... there is no need to create linked server... OP wants data to access from other database and not other server.This should do fine if db is present in same server..
insert into table1(col1,col2,col3)
select col1, col2, col3 from database2.owner2.table2
or as Brandy said, openrowset query...
Link server is only necessary if the database is on a different server. If the database is on the same server, the 3-level naming is sufficient.
😛
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply