Querying 2 tables in different databases

Is there any query code that will allow joining tables that are in different databases running on the same server If yes, how is the connection to each handled



Answer this question

Querying 2 tables in different databases

  • JRHudnutt

    You are right, on the client side you can use the same (only one Connection), the rest is handled on the server side.

    HTH, Jens Suessmeyer.


  • Matt Wyckhouse

    Sure, you can use the four (or three) part notation for this:

    SELECT <columnlist> FROM Database.owner.Objectname

    HTH, Jens Suessmeyer.


  • L. von Wyss

    When connecting to the databases with ADO do you open the databases using the same connection object Seems like you would have to.


  • Querying 2 tables in different databases