Red Gate forums :: View topic - SQL Compare - Disable Check for Source Drift
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

SQL Compare - Disable Check for Source Drift

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
jkennedy



Joined: 26 Jul 2012
Posts: 9

PostPosted: Wed May 29, 2013 4:27 pm    Post subject: SQL Compare - Disable Check for Source Drift Reply with quote

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?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6580

PostPosted: Mon Jun 03, 2013 10:07 am    Post subject: Reply with quote

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 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.
Back to top
View user's profile Send private message
jkennedy



Joined: 26 Jul 2012
Posts: 9

PostPosted: Wed Jun 05, 2013 7:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6580

PostPosted: Fri Jun 07, 2013 11:42 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
jkennedy



Joined: 26 Jul 2012
Posts: 9

PostPosted: Mon Sep 09, 2013 9:14 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group