Table views over multiple databases

Hi champs!

Is it possible to make a database View over two different database installations on different machines

Many thanks

kurlan




Answer this question

Table views over multiple databases

  • DJeX

    Also if the databases resides on two different SQL servers

  • mcssnt

    Please take a look at the linked servers functionality. If you create a linked server to a remote data source then you can use 4-part names to reference tables/views on the remote server or use OPENQUERY to send a pass-through query. You can use 4-part object names or OPENQUERY in FROM clause just like any local table source. See Books Online for more details.

  • xzhutiger

    Yes. It ispossible in SQL 2000. You can drag a table from another database to a view in the current database you are using.

    example select query is:

    SELECT *
    FROM
    dbo.Table1A INNER JOIN [Database2].dbo.Table1
    ON dbo.Table1A.Key= [Database2].dbo.Table1.Key

    Where Table1A is a table from current database

    And Table1 is another table from another database named Database2


  • Table views over multiple databases