如何使用SQL Server Management Studio验证两个数据库是否相同

时间:2022-09-25 15:44:43

I have two databases in two networks. I want to check one against another for to see table definition mismatches. I have database definition scripts of both databases. Is there any built-in function in SQL Server to achieve this.?

我在两个网络中有两个数据库。我想检查另一个,以查看表定义不匹配。我有两个数据库的数据库定义脚本。 SQL Server中是否有任何内置函数来实现此目的。

All the configurations in database servers are similar. The server version is SQL Server 12.0.2.

数据库服务器中的所有配置都类似。服务器版本是SQL Server 12.0.2。

Update: I know there are text comparison tools, and I use beyond compare.

更新:我知道有文本比较工具,我使用超越比较。

1 个解决方案

#1


2  

If you have the database definition scripts the easy way is to use diff on the UNIX (or Mac) command line, or windiff in Windows (see https://answers.microsoft.com/en-us/windows/forum/windows_10-files-winpc/does-windiff-exec-available-in-windows-10-64-bit/624fb262-7cba-49bd-b02e-74814a4d11b6?auth=1).

如果您有数据库定义脚本,那么简单的方法是在UNIX(或Mac)命令行上使用diff,或在Windows中使用windiff(请参阅https://answers.microsoft.com/en-us/windows/forum/windows_10-文件 - winpc /不-WinDiff的-EXEC可用功能于Windows的10-64位/ 624fb262-7cba-49bd-b02e-74814a4d11b6?AUTH = 1)。

Otherwise you can use a database design tool. There are many available but they all cost a lot more than using diff.

否则,您可以使用数据库设计工具。有许多可用,但它们都比使用差异花费更多。

#1


2  

If you have the database definition scripts the easy way is to use diff on the UNIX (or Mac) command line, or windiff in Windows (see https://answers.microsoft.com/en-us/windows/forum/windows_10-files-winpc/does-windiff-exec-available-in-windows-10-64-bit/624fb262-7cba-49bd-b02e-74814a4d11b6?auth=1).

如果您有数据库定义脚本,那么简单的方法是在UNIX(或Mac)命令行上使用diff,或在Windows中使用windiff(请参阅https://answers.microsoft.com/en-us/windows/forum/windows_10-文件 - winpc /不-WinDiff的-EXEC可用功能于Windows的10-64位/ 624fb262-7cba-49bd-b02e-74814a4d11b6?AUTH = 1)。

Otherwise you can use a database design tool. There are many available but they all cost a lot more than using diff.

否则,您可以使用数据库设计工具。有许多可用,但它们都比使用差异花费更多。