How to compare data between two table in different databases using Sql Server 2008?

前端 未结 9 2260
一生所求
一生所求 2020-12-13 17:41

I have two database\'s, named DB1 and DB2 in Sql server 2008. These two database\'s have the same tables and same table data also. However, I want to check if there are an

9条回答
  •  鱼传尺愫
    2020-12-13 17:53

    If the database are in the same server use [DatabaseName].[Owner].[TableName] format when accessing a table that resides in a different database.

    Eg: [DB1].[dbo].[TableName]

    If databases in different server look at on Creating Linked Servers (SQL Server Database Engine)

提交回复
热议问题