Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2005
    Posts
    2

    Unanswered: Run a select from against two dbs.

    Hi,

    is there any possiblity to run a select statement against the tables of two different databases which are both installed on the same database server ? Does anybody know how to join those tables reasonable way ?

    Thnx

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    47
    select *
    from db1.dbo.table1 t1 inner join db2.dbo.table2 t2
    on t1.pk = t2.pk
    -----------------
    KH


  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Check BOL.

    -PatP

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Use Linked Servers concept and BOL is your friend.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Linked servers unnecessary since both dbs on same server.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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