I recently downloaded a free trial of RedGate's SQL Compare software. I need to prove it is a useful tool to my company so we can get some liscenses, but also want to get a couple DB schemas in sync. I am trying to do a schema comparison on 2 databases, but I am getting some unwanted behavior. The problem is appearing when we use the DEFAULT
constraint for getdate()
. Sql Compare displays this as a difference, when really it is the same.
[lst_updt_dtm] [datetime] NOT NULL CONSTRAINT [DF__event_fil__lst_u__26667738] DEFAULT (getdate()),
Is different than
[lst_updt_dtm] [datetime] NOT NULL CONSTRAINT [DF__event_fil__lst_u__668030F6] DEFAULT (getdate()),
I would like to ignore these as differences and get a true comparison of where the schema changes. My research efforts led me to a few people with this same issue, but in all cases redgate responds with something like, "This feature does not exist and will be considered for future release" :
http://www.red-gate.com/messageboard/viewtopic.php?t=8816
However, I could not find any information about this that was less than 5 years old, so I am hoping that since then, they have added this feature
I've tried looking through the project options and experimenting with them, but nothing seems specific to this problem. The closest thing I found was this:
Ignore constraint and index names
Ignores the names of indexes, foreign keys, primary keys, and default, unique, and check constraints when comparing databases. The names will not be ignored when the databases are deployed.
When applying this option, it seems to have resolved the issues, many of those items were changed from "Differences" to "Identical Objects". But I am worried this is just providing me with a false positive. I do not want to always ignore Constraints and Keys.
Also, if what I am trying to accomplish is truly not possible with the current version of Sql Compare, I need a way to ignore these differences when reporting and deploying. I was thinking the following workarounds may be possible:
lst_updt_dtm
and archived_dtm
Ignore names of constraints only ignores the name of the constraint. All other properties on the constraint are still evaluated. You can also ignore names of constraints when these names are generated automatically by SQL Server, so the names are still compared unless SQL Server named the constraint for you.