Statistics-related bug in SDC 5
dfurman0
Posts: 2
Using SQL Data Compare 5.3.0.68.
When there are user-defined (not auto-generated) statistics on a table, and the "Drop primary keys, indexes, and unique constraints" option for the project is checked, SDC will treat those user-defined statistics as nonclustered indexes, and will try to drop them using DROP INDEX at the beginning of the script and create them using CREATE INDEX at the end, which results in an error and fails the script.
The only workaround I found is to drop the stats before the comparison and recreate them afterwards, which is not very practical for large databases.
It should be fairly easy to reproduce this. I can post a repro script, if necessary.
When there are user-defined (not auto-generated) statistics on a table, and the "Drop primary keys, indexes, and unique constraints" option for the project is checked, SDC will treat those user-defined statistics as nonclustered indexes, and will try to drop them using DROP INDEX at the beginning of the script and create them using CREATE INDEX at the end, which results in an error and fails the script.
The only workaround I found is to drop the stats before the comparison and recreate them afterwards, which is not very practical for large databases.
It should be fairly easy to reproduce this. I can post a repro script, if necessary.
Comments
I can see how that would be a problem. I have logged this down as a bug to be fixed in a future version. Thanks for letting us know.
I'm happy to say that this will be fixed in SQL Data Compare version 6, when it is finally released.