November 22, 2008 at 6:19 pm
Can someone tell me the best way to joing two tables that are in seperate databases on the same server.
ie: I need to join a Company table to a address table like. utbCompanyUtbAddress on CompanyID = AddressID
The utbCompanyUtbAddress table is in the same database as the Company table not the address table. So I need to figure this out.
Thanks
Erik
Dam again!
November 23, 2008 at 4:07 am
Hi,
If the databases are in the same SQL Server instance, use the fully qualified name; database.schema.object_name e.g.:
mydatabase.dbo.address
If they reside on different servers, or different instances on the same machine, you need to set up a linked server (see "Linked Servers" in Books Online).
HTH
/Elisabeth
elisabeth@sqlserverland.com
MCITP | MCT
http://sqlblog.com/blogs/elisabeth_redei/
http://linkedin.com/in/elisabethredei
November 23, 2008 at 9:19 am
Thank you...
Dam again!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply