Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server diff tool

Working on a team where people are prone to amending dev SQL Server tables and forgetting about it, or preparing a change for deployment and having to wait for that deployment. This leaves our dev and live tables inconsistent, causing problems when SPROCs are pushed live.

Is there a tool whereby I can enter a SPROC name and have it check all tables referenced in it in the dev and live DBs, and notify of any differences?

like image 521
AngryWebGuy Avatar asked Aug 05 '09 08:08

AngryWebGuy


People also ask

What is SQL Compare tool?

SQL Compare allows you to work with live SQL Server databases, snapshots, script folders, and native backups. You can compare your SQL Server databases, analyze differences, and perform error-free schema synchronization using generated SQL scripts.

How can I compare two SQL files in SSMS?

Q: Can I compare SQL objects from SSMS ApexSQL Compare offers integration for SSMS and Visual Studio, so you can right-click a SQL object in Object Explorer, select the Compare scripts in the right-click context menu, then Set as left/right, and the New comparison query window will be shown.

How can I find the difference between two tables in SQL Server?

Compare Tables Data Using a LEFT JOIN The LEFT JOIN T-SQL keyword is used to retrieve data from two tables, by returning all records from the left table and only the matched records from the right table and NULL values from the right table when there is no matching between the two tables.


1 Answers

I know two excellent tools for diffing SQL database structures - they don't specifically look inside stored procedures at their text, but they'll show you structural differences in your databases:

  • RedGate SQL Compare
  • ApexSQL's SQL Diff

Redgate also has a SQL Dependency Tracker which visualizes object dependencies and could be quite useful here.

Marc

like image 109
marc_s Avatar answered Oct 19 '22 10:10

marc_s