SQL Compare - Disable Check for Source Drift

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

SQL Compare - Disable Check for Source Drift

Postby jkennedy » Wed May 29, 2013 4:27 pm

When attempting to deploy using SQL Compare (either creating a script or using SQL Compare) I get an error: "SQL Compare - Aborting" and the failure was in Checking for source drift. Here is the actual error:

A duplicate definition was found for the index PK_[tablename]. Ensure that case sensitivity options are set correctly and all object creation scripts are valid. If the problem persists, contact our support.

The aforementioned table and index are exactly the same on the source and destination that I'm working with. Does anyone know:

1) What exactly is Source Drift checking for?
2) How do I fix the issue?
3) How can I ignore this check?
jkennedy
 
Posts: 9
Joined: Thu Jul 26, 2012 4:25 pm

Postby Brian Donahue » Mon Jun 03, 2013 10:07 am

Source Drift is when the version of the database scripts retrieved from source control doesn't match the version of the database.

The VCS you use has put the scripts on disk that are one version, and the database says it's a different version.

The "database" version is kept in a database-level extended property.
Code: Select all
SELECT value FROM fn_listextendedproperty('SQLSourceControl Database Revision', NULL,NULL,NULL,NULL,NULL,NULL)


A few different things could have caused this, like restoring a previous version of the database or reverting some change in the source-controlled version.

You should have the latest version of the database and the latest version of the scripts. You can make sure you have not restored an older version of the database and/or going into "SQL Source Control" and doing a "get latest" operation. I am assuming you are comparing with "source control" as the source.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby jkennedy » Wed Jun 05, 2013 7:44 pm

Thanks for the quick reply Brian. What's wierd is I'm actually performing a database to database compare and still getting this error. I do have SQL Source Control installed on the destination. And when trying to view history on an object, I'm getting a similar error:

A duplicate definition was found for the index [index name]. Ensure that case sensitivity options are set correctly and all object creation scripts are valid. If the problem persists, contact our support.

Maybe this is a SQL Source Control issue.
jkennedy
 
Posts: 9
Joined: Thu Jul 26, 2012 4:25 pm

Postby Brian Donahue » Fri Jun 07, 2013 11:42 am

What happens is SQL Compare sees this extended property in teh database, then it checks it out and tries to compare it to the live database.

So there is probably a duplicate definition in the source controlled version.

I think you can avoid it by deleting the extended properties from the database.

Otherwise check the files out of source control and see where the duplicate definition is.

The extended properties are called:
  • SQLSourceControl Database Revision
  • SQLSourceControl Scripts Location
  • SQLSourceControl Migration Scripts Location
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby jkennedy » Mon Sep 09, 2013 9:14 pm

I actually resolved the issue. The problem was that we replaced a view with a table of the same name. SQL Source Control (or SQL Compare) appeared to be validating the new table definition before factoring in the view delete and an exception was thrown. Went in and manually removed the view from TFS and everything worked great.
jkennedy
 
Posts: 9
Joined: Thu Jul 26, 2012 4:25 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest