I have a Data Compare project that clashes with our change data capture configuration.
I get:
The unique index 'PK_…' on table '[dbo].[…]' is used by Change Data Capture. The constraint using this index cannot be dropped or disabled.
I have unchecked the “Drop primary keys, indexes, and unique constraints” option.
The script contains at the start:
PRINT(N'Drop unused indexes from [dbo].[…]')ALTER TABLE [dbo].[…] DROP CONSTRAINT [PK_…]
and at the end:
PRINT(N'Add indexes to [dbo].[…]')ALTER TABLE [dbo].[…] ADD CONSTRAINT [PK_….] PRIMARY KEY CLUSTERED ([Id]) WITH (FILLFACTOR=90) ON [PRIMARY]
Why would Data Compare put this in the script, although I did configure it not to include it?
I am also confused by the comment “Drop unused indexes from”. How could a clustered primary key not be used?
1 comment
Found the solution. Unused does not mean unused in the database, it means unused in the comparison.
For this specific table, there was a custom comparison key on an alternate key. Restoring it to be the primary key solved my issue.
Please sign in to leave a comment.
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy
I have a Data Compare project that clashes with our change data capture configuration.
I get:
I have unchecked the “Drop primary keys, indexes, and unique constraints” option.
The script contains at the start:
and at the end:
Why would Data Compare put this in the script, although I did configure it not to include it?
I am also confused by the comment “Drop unused indexes from”. How could a clustered primary key not be used?