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
 Querying across two servers

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2011-07-27 : 07:50:45
Hello everyone. quick question, I want to query 2 servers at once joining two tables.

do i have to fully qualify everything.ie

select ref,name from [server1]..dbo.table1

inner join [server2]..dbo.table2

on blah blah blah.

MCTS / MCITP certified

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-07-27 : 08:00:20
more like Server.DATABASE.owner.table, then you can alias. You also need to set up the linked server is you haven't already..
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2011-07-27 : 08:10:25
its ok, sorted it, thank you for your reply.

yes, i have created a linked server. all done.

Thank you for your help. maybe i should read before i post. lol
Go to Top of Page
   

- Advertisement -