Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare two versions of a stored procedure

Tags:

sql-server

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.

like image 715
user1246945 Avatar asked Oct 08 '22 12:10

user1246945


1 Answers

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.

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.

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.

like image 193
JackAce Avatar answered Oct 12 '22 10:10

JackAce