linking two different tables in seperate databases

  • 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!

  • 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

  • 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