What are the challenges you face when working across database platforms? Take the survey
Options

GetMigrationSQL per table ignores DropConstraintsAndIndexes

Hi,

I have a follow-up on this thread:
http://apps.red-gate.com/messageboard// ... hp?t=16164
(which was solved, by the way).

I (again) have a table with a unique index and a clustered index, as written in the other thread.
When calling the method "GetMigrationSQL" of the SQLDataCompare.Engine.SqlProvider, I get the migration SQL. I use the option DropConstraintsAndIndexes to let the script include DROP statements for my unique index and clustered index.
This works perfectly.

However, when I call the method "GetMigrationSQL" with a different overload (per table), I do NOT get these DROP statements.

More details about this issue:

The script that was being generated with "GetMigrationSQL" was getting pretty large for an entire database, when using the overload
"objSqlProvider.GetMigrationSQL(objComparisonSession, True)" to get the entire script.

Therefore, I changed my code to loop through all TableDifferences in the ComparisonSession, and then call the method "GetMigrationSQL" with this overload:
objSqlProvider.GetMigrationSQL(objComparisonSession, objTableDifference, True)
But then the DROP statements for the unique index and clustered index aren't included!

Why is this, and what can I do to overcome this?

PS: I also tried using version 10.2.4.113 of RedGate.SQLDataCompare.Engine.dll, but the problem still occurs.

Comments

Sign In or Register to comment.