Skip to content

Repository files navigation

#zenSQLcompare Compare SQL Server schemas and create scripts "for most" differences

Getting started

  1. Take latest release https://github.com/marcinKotynia/zenSQLcompare/releases
  2. download and install http://winmerge.org/ , adjust proper folder path
  3. provide or paste connection strings
  4. go to tab compare database schema select "Start Compare"
  5. copy paste generated script to your favourite sql editor

Version

  • 1.4.0 Bug Fixes, helper Scripts (2015-08)
  • 1.2.1 no additional library need, no instalation just unzip and run
  • 1.2.1 Generate T-SQL scripts to update one database to match the schema of another
  • 1.2.1 Save/load configuration to file
  • 1.2.1 Define Excluded object list
  • 1.2.1 Show difference in schema in external tool (ex. http://winmerge.org/)
  • 1.3 Support for index compare

History

This is old, ugly code and tool but it works :) first version was created aboout 2003 in VB6 converted to .net as IS in 2008 its still useful and updated.

zenComparer will solve most basic schema differencies including:

Object TypeDescriptionRepair scriptDisplay information
Tables (U)Missing tableYESYES
Missing columnYESYES
Missmatched column Data typeYESYES
Missmatched column character_maximum_lengthYESYES
Missmatched column defaultYESYES
Scalar Funtions (FN)Missmatched Scalar FuntionYES

YES

Missing Scalar FuntionYESYES
Scalar Funtions (IF)Missmatched Scalar FuntionYESYES
Missing Scalar FuntionYESYES
Table-valued Function (TF)Missmatched Table-valued FunctionYESYES
Missing Table-valued FunctionYESYES
Procedures (P)Missmatched ProcedureYESYES
Missing ProcedureYESYES
Triggers (TR)Missmatched TriggerYESYES
Missing TriggerYESYES
Views (V)Missmatched ViewYESYES
Missing ViewYESYES
Index (IX)Missmatched IndexYESYES
Missing IndexYESYES

What zenSQLCompare will not do for you

  • Solve multiple dependant problems (it will provide some helper scripts for manual adjustments)
  • Create completly new table (you can always script in Managment Studio)

Bugs

Scenario Comparing

  • database 1 and "Uniqued index"
  • database 2 and "Unique Key" (constraint)

Result invalid script - partial

How to solve Drop constraint first

ALTER TABLE [table name] DROP CONSTRAINT [index name] 

About

Tool for Comparing Microsoft SQL database SCHEMA

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages