#zenSQLcompare Compare SQL Server schemas and create scripts "for most" differences
- Take latest release https://github.com/marcinKotynia/zenSQLcompare/releases
- download and install http://winmerge.org/ , adjust proper folder path
- provide or paste connection strings
- go to tab compare database schema select "Start Compare"
- copy paste generated script to your favourite sql editor
- 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
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 Type | Description | Repair script | Display information |
---|---|---|---|
Tables (U) | Missing table | YES | YES |
Missing column | YES | YES | |
Missmatched column Data type | YES | YES | |
Missmatched column character_maximum_length | YES | YES | |
Missmatched column default | YES | YES | |
Scalar Funtions (FN) | Missmatched Scalar Funtion | YES |
YES |
Missing Scalar Funtion | YES | YES | |
Scalar Funtions (IF) | Missmatched Scalar Funtion | YES | YES |
Missing Scalar Funtion | YES | YES | |
Table-valued Function (TF) | Missmatched Table-valued Function | YES | YES |
Missing Table-valued Function | YES | YES | |
Procedures (P) | Missmatched Procedure | YES | YES |
Missing Procedure | YES | YES | |
Triggers (TR) | Missmatched Trigger | YES | YES |
Missing Trigger | YES | YES | |
Views (V) | Missmatched View | YES | YES |
Missing View | YES | YES | |
Index (IX) | Missmatched Index | YES | YES |
Missing Index | YES | YES |
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)
- 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]