SQL Compare stopped working

Forum for users of SQL Compare schema synchronization utility

SQL Compare stopped working

Postby AlexKuznetsov » Thu Jan 02, 2014 4: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:

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, - that did not fix the problem.
Posts: 4
Joined: Thu Nov 15, 2012 2:59 pm

Postby AlexKuznetsov » Thu Jan 02, 2014 9: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.
Posts: 4
Joined: Thu Nov 15, 2012 2:59 pm

Postby Chris Auckland » Mon Jan 06, 2014 3: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 Auckland
Posts: 760
Joined: Tue Oct 24, 2006 1:12 pm
Location: Red Gate Software Ltd.

Return to SQL Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests