Visual Studio 2017 中的 SQL Server 比较架构

我正在尝试比较同一服务器上两个数据库的架构.

I am attempting to compare schemas of two databases on the same server.

这两个数据库分别命名为benchmarkdbbenchmarkdb_dev.

The two databases are named benchmarkdb and benchmarkdb_dev.

在 Visual Studio 2017 中,我转到工具 > SQL Server > 新架构比较...

In Visual Studio 2017, I go to Tools > SQL Server > New Schema Compare...

从标记为选择源"和选择目标"的两个下拉菜单中(如下图所示),我想选择 benchmarkdb 作为源和 bencmarkdb_dev作为目标.

From both drop down menus labeled "Select Source" and "Select Target" (as seen in the picture below), I want to select benchmarkdb as source and bencmarkdb_dev as target.

点击选择一个源后,弹出Select Source Schema",我点击了Select Connection..."按钮,又弹出了一个.最新的弹出窗口(下图中右侧的那个)显示了我要比较的两个数据库.

After clicking to select a source, the "Select Source Schema" pops up, and I clicked the "Select Connection..." button, which brought another popup. The newest popup (the one on the right in the picture below) shows both databases I am trying to compare.

但是,在我为源或目标选择一个之后,所有弹出窗口都会关闭,但选择源..."或选择目标..."下拉菜单中没有任何内容.事实上,它只是回到看起来像第一张照片.

However, after I choose one for either the source or the target, all pop ups close, but nothing populates the "Select Source..." or "Select Target..." drop down menus. In fact, it just goes back to looking like the first picture.

是否有解决方案,以便我可以比较数据库之间的架构?

Is there a solution to this so I can compare the schemas between the databases?

更新:

我已在 VS 2012、2015 和 2017 上尝试过此操作.所有人都面临同样的问题.VS软件和系统软件是最新的.以下是我正在使用的一些软件版本,如果有帮助的话.

I have tried this on VS 2012, 2015, and 2017. All are facing the same issue. VS software and system software are up to date. Below are some versions of software that I am using, if it is any help.

Windows 7 企业版 SP1

Windows 7 Enterprise SP1

与 2012 年、2015 年和 2017 年相比

VS 2012, 2015, and 2017

SQL Server 2014

SQL Server 2014

.NET Framework v4.7.02053

.NET Framework v4.7.02053

推荐答案

好的,所以我设法解决了它.首先,您需要从 Microsoft 页面安装 SSDT.只是谷歌它.确保在启动安装程序时(在修改时)也将其列在各个组件中.只需要 SQL Server 数据库(我可以从 Integration Services 和另外 3 个中选择).

OK, so I managed to fix it. First off, you need to install SSDT from Microsoft pages. Just google it. Make sure that you also have it listed in individual components when starting Installer (on Modify). Only SQL Server Database is required (I could choose from Integration Services and 3 more).

接下来,您需要在模式比较模式中从历史中删除连接"以进行连接选择.

Next, you need to "Remove connection from history" in Schema Compare modal for connection selection.

此时我关闭了 VS,以确保该连接不再存在于历史记录中.下次启动VS,你应该不会有历史上有问题的连接.

I closed VS at this point, to make sure that the connection is not in history anymore. Starting VS the next time, you should not have the problematic connection in history.

重新创建连接(我检查了记住密码"),瞧.模式比较有效.

Recreate the connection (I checked "remember password") and voila. Schema compare works.

不太确定,但无奈之下我还安装了Redgate ReadyRoll Core"、Redgate SQL Prompt Core"和Redgate SQL Search".我认为这并不重要,但如果一切都失败了......

Not really sure, but in desperation I also installed "Redgate ReadyRoll Core", "Redgate SQL Prompt Core" and "Redgate SQL Search". I don't think it matters, but if all else fails...

这在 2 台机器上工作,它似乎没有连接到 VS 版本.

This worked on 2 machines and it doesn't seem to be connected to VS version.

相关文章