John
- You can do this through FOUR part naming convention using Linked Server.
-
PULL is the best approach instead of PUSH. So, You can Pull the data from Table2 to Table1...
Validate whether you have valid Linked Server between those server (Server1 and Server2)
- Go to
Server1 and do the following...
1. Validate that you can access the Server2 from Server1:
EXEC sp_testlinkedserver N'Server2'
Go
It should return
Command(s) completed successfully.
If so, You can do the following approach
Insert Table1
Select * from Server2.DB2.dbo.Table2
Go
If you doesn't have Linked server already configured on that server "Server1". Do the following...
1. Configure Linked Server to Server2
Exec Sp_AddLinkedServer 'Server2'
Go
2. Provide access rights to the Server2
Exec Sp_AddLinkedsrvLogin 'Server2',False,'sa','sa','*****'
Go
3. Validate the Linked server
EXEC sp_testlinkedserver N'Server2'
Go
Now You can use the following script
Insert Table1
Select * from Server2.DB2.dbo.Table2
Note: You can use some other credentials to Server2 instead of '
sa'
Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions
Johnseelan, if this helps please login to Mark As Answer. | Alert Moderator