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
 Compare tables of different servers

Author  Topic 

vignesht50
Yak Posting Veteran

82 Posts

Posted - 2014-10-08 : 03:01:23
Hi,

I have two databases under two different servers.

Server1:
DB1
Table1

Server2:
DB2
Table2

I need to compare Table 1 & 2 using SQL server and how can I achieve this? Really appreciate any help on this.

sunder.bugatha
Yak Posting Veteran

66 Posts

Posted - 2014-10-08 : 03:35:15
import the table Table2 into db1 of server1 and use join to compare the 2 tables.

Hema Sunder
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2014-10-08 : 03:48:58
You have two options:

1) Add another server as linked server and then you can use OPENQUERY to compare tables
2) Use OPENROWSET to connect to select from the table on different server and compare it with current table.

Harsh Athalye
http://in.linkedin.com/in/harshathalye/
Go to Top of Page
   

- Advertisement -