sql-server - Visual Studio SSDT Data Compare如何比较单个数据库中的两个表

标签 sql-server visual-studio-2012 sql-server-data-tools data-comparison

尝试在 SSDT 中进行一些简单的数据比较,但事实证明有点困难。

在一个数据库中,我有两个要比较的表。

这些表具有相同的架构,只是表名称不同。我只是想看看这个工具是否能给我一个很好的方法来比较两者的数据。

tblOutput
tblOutput_210314

但是选择两个表在单个数据库中相互比较我不知道如何实现。

似乎您只能选择源数据库和目标数据库中都存在的表名称。由于我的源数据库和目标数据库相同,我基本上是将我的表与其本身进行比较?

有人知道如何使用数据比较来实现这一目标吗?

  • Visual Studio 2012
  • SQL Server 数据工具
  • 数据比较

最佳答案

数据比较仅支持比较具有匹配架构的 2 个不同数据库。不幸的是,您无法使用数据比较来完成您想要的事情。来自 help documentation :

Requirements

When you compare data in a table or view, the table or view in the source database must share several attributes with a table or view in the target database. Tables and views that do not meet the following criteria are not compared and do not appear on the second page of the New Data Comparison wizard:

  • Tables must have matching column names that have compatible data types.
  • Names of tables, views, and owners are case-sensitive.
  • Tables must have the same primary key, unique index, or unique constraint.
  • Views must have the same unique, clustered index.
  • You can compare a table with a view only if they have the same name.

关于sql-server - Visual Studio SSDT Data Compare如何比较单个数据库中的两个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22220605/

相关文章:

sql-server - SQL Server 2008 R2 : Tricky query - Finding certain rows in segments of rows

asp.net - 如何限制数据输入用户在我的网站上只能工作 8 小时

sql-server - 模式比较检测相同存储过程的差异

c++ - std::chrono::high_resolution_clock 的分辨率与测量值不对应

sql-server - 如何更新activeX脚本任务

C++11 lambda 返回 lambda

visual-studio-2015 - 在 VS 2015 SQL Server 数据库项目中导入数据库

c# - Entity Framework ,Dapper和SSDT的组合?

sql-server-data-tools - 数据层应用程序版本号存储在 Visual Studio 项目中的什么位置?

sql - 是否可以告诉 SSMS 不检查 t-sql 脚本中是否存在列?