比较存储过程的两个版本

时间:2021-01-28 05:32:52

I want to compare two stored procedures, and I need to find out which lines were added, modified or deleted in the new stored procedure.

我想比较两个存储过程,我需要找出在新存储过程中添加,修改或删除的行。

2 个解决方案

#1


3  

You should be using source control on the scripts that you use to create/alter the stored procedures. You can use SVN or git for this. Then diffing the versions of the file becomes trivial, as the source control client will come with a diffing tool.

您应该在用于创建/更改存储过程的脚本上使用源代码控制。您可以使用SVN或git。然后区分文件的版本变得微不足道,因为源控件客户端将带有一个diffing工具。

If you just want to diff two files, you can use WinMerge (free), which is great, or even FC.EXE (the file comparison tool that comes with Windows) to compare two files.

如果您只想区分两个文件,可以使用WinMerge(免费),这很棒,甚至可以使用FC.EXE(Windows附带的文件比较工具)来比较两个文件。

If you want a better (but more difficult solution to implement), I'd suggest using Red Gate Source Control on top of SVN or git. Red Gate Source Control integrates with SSMS, so you can commit changes and view differences within the tool.

如果你想要一个更好的(但更难实现的解决方案),我建议在SVN或git之上使用Red Gate Source Control。红门源控件与SSMS集成,因此您可以提交更改并查看工具内的差异。

#2


0  

You don't gave to use RedGate's Source Control, or source control at all. You can use Red Gate's SQL Compare to both compare and synchronize the stored procedures in your databases. No scripting, no source control. Google for 'compare and synchronize SQL objects', there are a lot of other tools for this.

您根本没有给出使用RedGate的源代码控制或源代码控制。您可以使用Red Gate的SQL Compare来比较和同步数据库中的存储过程。没有脚本,没有源代码控制。 Google用于“比较和同步SQL对象”,还有很多其他工具可供选择。

#1


3  

You should be using source control on the scripts that you use to create/alter the stored procedures. You can use SVN or git for this. Then diffing the versions of the file becomes trivial, as the source control client will come with a diffing tool.

您应该在用于创建/更改存储过程的脚本上使用源代码控制。您可以使用SVN或git。然后区分文件的版本变得微不足道,因为源控件客户端将带有一个diffing工具。

If you just want to diff two files, you can use WinMerge (free), which is great, or even FC.EXE (the file comparison tool that comes with Windows) to compare two files.

如果您只想区分两个文件,可以使用WinMerge(免费),这很棒,甚至可以使用FC.EXE(Windows附带的文件比较工具)来比较两个文件。

If you want a better (but more difficult solution to implement), I'd suggest using Red Gate Source Control on top of SVN or git. Red Gate Source Control integrates with SSMS, so you can commit changes and view differences within the tool.

如果你想要一个更好的(但更难实现的解决方案),我建议在SVN或git之上使用Red Gate Source Control。红门源控件与SSMS集成,因此您可以提交更改并查看工具内的差异。

#2


0  

You don't gave to use RedGate's Source Control, or source control at all. You can use Red Gate's SQL Compare to both compare and synchronize the stored procedures in your databases. No scripting, no source control. Google for 'compare and synchronize SQL objects', there are a lot of other tools for this.

您根本没有给出使用RedGate的源代码控制或源代码控制。您可以使用Red Gate的SQL Compare来比较和同步数据库中的存储过程。没有脚本,没有源代码控制。 Google用于“比较和同步SQL对象”,还有很多其他工具可供选择。