Dropping Constraints and Indexes
mtran
Posts: 34
I am trying to sync records between two tables in two different databases but I keep getting the UNIQUE_VALIDATION error/ UNIQUE KEY constraint.
sqloptions is an enum that passed in as
DBSqlOptions is an enum of SqlOptions
Why is this not working?
Thanks
session.Options.SqlOptions = (SqlOptions)sqloptions;
sqloptions is an enum that passed in as
DBSqlOptions.DropConstraintsAndIndexes | DBSqlOptions.ReseedIdentity | DBSqlOptions.DisableKeys | DBSqlOptions.UseTransactions
DBSqlOptions is an enum of SqlOptions
Why is this not working?
Thanks
Comments
Are you also setting the provider options? These are the options that will be used when generating the migration script. e.g.
provider.Options = session.Options;
Error : The constraint 'PK__TABLE1__2E31B632' is being referenced by table 'TABLE2', foreign key constraint 'FK_TABLE2_TABLE1'.
Could not drop constraint. See previous errors.
I have set the provider.Options = session.Options. It is only syncing TABLE1, TABLE2 records are already identical.
Thanks