August 28, 2001 at 12:47 am
hello there,
i want to access two different tables a and b which are in two different databases d1 and d2 is there any way out
thanks keyur
August 28, 2001 at 4:21 am
Just fully qualify the names, like this:
select a.id, b.id from db1.dbo.test a inner join db2.dbo.test b on a.id=b.id
If you set up a linked server, you can even do this across servers by using four part syntax:
select a.id, b.id from db1.dbo.test a inner join DifferentServer.db2.dbo.test b on a.id=b.id
Andy
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy