Search code examples
sqlsql-servert-sqlstored-procedures

Compare code between two stored procedures in two different databases in SQL Server


There are two stored procedures which has same name and same logic. But in different databases. Only some of the content names are different (example - Synonym Name, Table Name, schema). Other code is the same.

Is there any way to compare code between above two stored procedures?


Solution

  • For many type of comparisons (folder, text, etc.) you can use Beyond Compare (they offers 30 days trial, but after it, you can simple reinstall it).

    enter image description here

    If you want something free, you can use a compare plugin for NotePad++ but is not so fancy as the first tool:

    enter image description here

    The Plugin Manager can be opened from Plugins -> Plugin Manager -> Show Plugin Manager.