2

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:

  1. Filter out the audit fields that this problem is occuring in, such as lst_updt_dtm and archived_dtm
  2. Manually go through and check off the items where this problem occurs (Please don't make me)
Cole9350
  • 5,444
  • 2
  • 34
  • 50
  • Dont you think this is something you should be asking redgate as its third-party application and not many people use it and also redgate technical helpline will be more then happy to brag about their product to you :) – M.Ali Apr 02 '14 at 21:09
  • Perhaps, but I figured this would fall under the category of support, which they may be reluctant to give me since I'm not an actual customer yet. Thanks though – Cole9350 Apr 03 '14 at 13:55
  • Your are a potential customer , trust me on this not only red gate any business will give priority to potential customers over their existing customers. They will be more than happy to help you :) – M.Ali Apr 03 '14 at 13:58
  • Yes this is true, I'll give that a shot. – Cole9350 Apr 03 '14 at 14:04

1 Answers1

3

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.

Wonko
  • 331
  • 1
  • 5
  • 1
    Ok, appreciate your response. Just to clarify, your saying the option I found "Ignore contraint and index names" would be the correct way to handle this? – Cole9350 Apr 03 '14 at 13:48
  • 1
    Yep - that would get it to stop comparing the constraint names. – Wonko Apr 07 '14 at 07:38
  • I'm accepting this as an answer, the option that I am using to solve this problem is actually "Ignore System Constraints and Index Names". Thank you – Cole9350 Apr 07 '14 at 13:42