Options

SQL Compare stopped working

AlexKuznetsovAlexKuznetsov Posts: 6
edited January 6, 2014 10:02AM in SQL Compare Previous Versions
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.

Comments

  • Options
    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.
  • Options
    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
Sign In or Register to comment.