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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Need help in Join two tables from diff servers

Author  Topic 

turbo
Starting Member

19 Posts

Posted - 2010-07-23 : 04:14:54

Pls Help :
Hi need help to join two tables from different servers in Ms sql 2005.

Thank You

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-07-23 : 04:25:02
Add the server on other system as Linked server and you can query ( and join ) using four part name.

Example:
select s.Empid , m.Ename, m.salary, s.commision from [130.78.158.168].fundb.dbo.Emp s, MyNewDb.dbo.Emp m
where s.EmpID = m.empid


select s.Empid , m.Ename, m.salary, s.commision from MyNewDb.dbo.Emp m inner join [130.78.158.168].fundb.dbo.Emp s
on s.EmpID = m.empid
Go to Top of Page

turbo
Starting Member

19 Posts

Posted - 2010-07-23 : 05:12:46
tHANKS A LOT .... I GOT IT . :-)
Go to Top of Page
   

- Advertisement -