"John Bell" <jb************@hotmail.com> wrote in message news:<3f***********************@reading.news.pipex .net>...
This request was posted earlier today under the title "Inter-Database
References"
John
"TNR" <st****@tgs.fr> wrote in message
news:bg**********@news-reader5.wanadoo.fr... How to make a query which contains fields from two different bases ?
Thanks in advance.
ReN
If your databases are on the same server then it's as simple as:
select *
from database1..table1 inner join database2..table2
if they are on different servers, then you'll need to add a linked
server to the database that you are running your query on. This can
be done through the GUI or by running sp_addlinkedserver system stored
procedure. Once you've done it then, the command is:
select *
from database1..table1 inner join linkedservername.database2..table2
Hope this helps
Hodge