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 2008 Forums
 Transact-SQL (2008)
 sql query between two different databases

Author  Topic 

sidhu688
Starting Member

2 Posts

Posted - 2011-03-28 : 20:44:09
Hello,
New to sql so need a little help.I have to join two tables which are in two different databases which are on different servers..can someone please tell me how can i do that.

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-28 : 20:59:57
You can use a linked server or OPENQUERY to reach the remote object. Just use the four-part naming convention to access it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sidhu688
Starting Member

2 Posts

Posted - 2011-03-28 : 21:10:24
Thanks for replying,

New to sql,Can you please give me a small example of this openquery.
Go to Top of Page
   

- Advertisement -