Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    NJ
    Posts
    2

    Unanswered: Join between tables on different databases

    Is it possible to make a join between two tables from different databases on same server? if yes, how can we do that?

    And also if I want to make a join between tables on different databases on different server?how to do this. Please advise.

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    BOL:

    SELECT Customers.CustomerID, Cst.FirstName, Cst.LastName
    FROM Northwind.dbo.Customers AS Cst

    You could use 'full' name of tables.

  3. #3
    Join Date
    Jan 2004
    Location
    Boston
    Posts
    58
    For tables on different dbs on different servers, you have to set up linked servers and use the FQDN (four part name convention) to refer to the talbes. Take a look at sp_addlinkedserver in BOL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •