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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insert into different db

Author  Topic 

silas2
Yak Posting Veteran

65 Posts

Posted - 2007-03-30 : 12:02:15
I'm using Sql Management express, I've got two servers loaded, what syntax do I need to run an insert between the two, e.g. "Select * from TableName In 'servername\dbname\tablename'?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-03-30 : 12:07:17
You need to add second server as a linked server and use <servername>.<database>.<owner>.<tablename> syntax to access the table data.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

yumyum113
Starting Member

31 Posts

Posted - 2007-03-30 : 13:13:53
if you will be running the script for one time perhaps you could also use OPENDATASOURCE statement.

Go to Top of Page
   

- Advertisement -