GetMigrationSQL per table ignores DropConstraintsAndIndexes
Bastiaan Molsbeck
Posts: 73
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.
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
Please read the other thread so I don't have to repeat all those steps again.
Could you please try the scenario I posted?
You should get the same results.
But when trying to get the migration SQL for a single table, it is NOT solved.
"PS: I also tried using version 10.2.4.113 of RedGate.SQLDataCompare.Engine.dll, but the problem still occurs."
I'm new to this: how will they communicate with me? In this forum topic, or directly via e-mail?