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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Comparison - multiple servers

Status
Not open for further replies.

nirmalsp

MIS
Jan 17, 2002
25
LK

Hi

i having same sql db in multiple servers in different sites
i need to do a field comparison in tables in same database in different servers.

is it possible.
can u help me on this

tks.
 

If you are running SQL 7 or higher, you can run queries against linked servers. See sp_addlinkedserver in SQL BOL.

Example: Find records on local server table that don't exist on remote table.

Select l.*
-- local server
From dbname.dbo.tblname l
-- remote server with 4-part object name
Left Join server2.dbname.dbo.tblname r
On l.RecID=r.RecID
Where r.RecID Is Null Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top