Thursday, April 2, 2009

How to Query 2 the tables on different server

First of all the Server must be added as Linked server using the below command

sp_addLinkedserver 'servername' w

then the table name should be in a full four part format

ServerName.DatabaseName.DatabaseOwner.TableName

for example TestSvr.TestDB.DBO.Testtbl

No comments: