Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert data from a table from antother database

Status
Not open for further replies.

HanzieV

Programmer
Apr 8, 2003
17
0
0
BE
Hello,

is it possible to insert data from a table from another database (I mean running on another server) using the insert into MyTalbe select MyFields from MyTable2 syntax (where MyTable2 is a table in antother database running on another server) ?? Or is there any other way using Transact SQL (so no DTS) ??

Best Regards,
Hans
 
yes it is possible.

try OPENROWSET method...

Known is handfull, Unknown is worldfull
 
Set up a linked server and then use:

Code:
INSERT table1
SELECT * FROM server2.db2.dbo.table2

--James
 
Hi all,

thanks for the replies. The openrowset method is what I was looking for !

Greetz,
Hans
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top