SQL数据比较 - 缺少一些表

时间:2021-06-29 21:34:30

When doing a Data Compare using SQL Server Data Tools through VS 2013 pro, I have a scenario where some tables appear to be getting missed out.

通过VS 2013 pro使用SQL Server数据工具进行数据比较时,我遇到了一些表格似乎被错过的情况。

What I mean by that is there is data in TableA on the source server but no data in the equivalent table on the destination server.

我的意思是源服务器上的TableA中有数据,但目标服务器上的等效表中没有数据。

However the results window doesn't even display a row for TableA.

但是,结果窗口甚至不显示TableA的行。

Also if I try to filter the results in the next step prior to pressing "Finish", TableA doesn't appear as an option to filter by. It's almost as if the table doesn't exist on the destination server. I've verified that is does by:

此外,如果我在按“完成”之前尝试在下一步中过滤结果,则TableA不会显示为过滤选项。这几乎就像目标服务器上不存在该表一样。我已通过以下方式验证:

  • Connecting through SSMS and viewing the list of tables
  • 通过SSMS连接并查看表列表
  • Running SELECT * FROM information_schema.tables
  • 运行SELECT * FROM information_schema.tables

In both cases I can see the table is listed.

在这两种情况下,我都可以看到列出的表格。

Has anyone else seen this? What am I missing?

有没有人见过这个?我错过了什么?

1 个解决方案

#1


15  

Data can be compared only if you know what records from tables must be compared. Comparer uses PK to know what records to compare. If your table don't have a PK (or at least a unique index) it ill be missing from the tables list.

只有在您知道必须比较表中的哪些记录时,才能比较数据。 Comparer使用PK来了解要比较的记录。如果您的表没有PK(或至少是唯一索引),那么表列表中就会丢失它。

You can solve it by creating a PK yourself (just for comparasion)

您可以通过自己创建PK来解决它(仅用于比较)

#1


15  

Data can be compared only if you know what records from tables must be compared. Comparer uses PK to know what records to compare. If your table don't have a PK (or at least a unique index) it ill be missing from the tables list.

只有在您知道必须比较表中的哪些记录时,才能比较数据。 Comparer使用PK来了解要比较的记录。如果您的表没有PK(或至少是唯一索引),那么表列表中就会丢失它。

You can solve it by creating a PK yourself (just for comparasion)

您可以通过自己创建PK来解决它(仅用于比较)