Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 799
Aslam Jiffry Avatar asked Jul 30 '15 06:07

Aslam Jiffry


People also ask

How do I compare schema between two databases in SQL Server?

To compare database definitions. On the Tools menu, select SQL Server, and then click New Schema Comparison. Alternatively, right-click the TradeDev project in Solution Explorer, and select Schema Compare. The Schema Compare window opens, and Visual Studio automatically assigns it a name such as SqlSchemaCompare1 .

How can I compare two tables of two different SQL servers?

Compare SQL Server Data in Tables Using the Tablediff Tool This can be found in "C:\Program Files\Microsoft SQL Server\110\COM\" folder. This command line tool is used to compare tables. It also generates a script with the INSERT, UPDATE and DELETE statements to synchronize the tables.


1 Answers

Personally i prefer to use a SSDT Project (SQL Server Data Tools)

It allows you to store the entire database schema in a Visual Studio project and in git/svn.

It is capable of comparing two databases (in full) or a database with the SSDT project schema. It will show you the differences and allow you to publish those differences.

Configurable and powerful.

I highly recommend it.

like image 182
Kris Avatar answered Nov 15 '22 08:11

Kris