SQL Compare stopped working

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 stopped working

Postby AlexKuznetsov » Thu Jan 02, 2014 5:48 pm

Without any changes on either client or server, I was getting this error when running SQL Compare 8.1:

Registering data sources - reading tables
An entry with the same key already exists.

The Profiler indicates that the last SQL issued by SQL Compare is as follows:

SELECT
d.is_fulltext_enabled AS FullTextEnabled,
d.is_encrypted AS IsEncrypted,
dec.key_algorithm AS KeyAlgorithm,
dec.key_length AS KeyLength
FROM sys.databases d
LEFT JOIN sys.dm_database_encryption_keys dec ON dec.database_id = d.database_id
WHERE d.database_id = DB_ID()

I happen to have a copy of my target which is one moth old. I was able to successfully run SQL compare against that old copy.

I upgraded to the latest version, 10.4.8.87 - that did not fix the problem.
AlexKuznetsov
 
Posts: 4
Joined: Thu Nov 15, 2012 3:59 pm

Postby AlexKuznetsov » Thu Jan 02, 2014 10:16 pm

The root cause of this seems to be an exclusive lock acquired by a clustered index rebuild. Once the index completed rebuilding, SQL Compare started working again.

A more helpful error message would be greatly appreciated.
AlexKuznetsov
 
Posts: 4
Joined: Thu Nov 15, 2012 3:59 pm

Postby Chris Auckland » Mon Jan 06, 2014 4:02 pm

Thanks for your post.

I agree that the error message isn't very helpful in this situation.

I suspect that while the index is being rebuild SQL Server creates a temporary copy which gets flagged as a duplicate when SQL Compare stumbles across it.

I'm not sure how to test for that, as I don't really know what SQL Server does internally while rebuilding, or if there is any way to determine if this kind of operation is being performed and warn the user.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests

cron