| Author |
Message |
mtran
Joined: 07 Oct 2008 Posts: 25
|
Posted: Wed Jan 07, 2009 4:40 pm Post subject: Dropping Constraints and Indexes |
|
|
I am trying to sync records between two tables in two different databases but I keep getting the UNIQUE_VALIDATION error/ UNIQUE KEY constraint.
| Code: |
session.Options.SqlOptions = (SqlOptions)sqloptions;
|
sqloptions is an enum that passed in as
| Code: |
DBSqlOptions.DropConstraintsAndIndexes | DBSqlOptions.ReseedIdentity | DBSqlOptions.DisableKeys | DBSqlOptions.UseTransactions
|
DBSqlOptions is an enum of SqlOptions
Why is this not working?
Thanks |
|
| Back to top |
|
 |
Chris Auckland
Joined: 24 Oct 2006 Posts: 710 Location: Red Gate Software Ltd.
|
Posted: Tue Jan 13, 2009 1:49 pm Post subject: |
|
|
Thanks for your post.
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; _________________ Chris |
|
| Back to top |
|
 |
mtran
Joined: 07 Oct 2008 Posts: 25
|
Posted: Thu Jan 15, 2009 8:00 pm Post subject: |
|
|
| Thanks! It works as expected now. |
|
| Back to top |
|
 |
mtran
Joined: 07 Oct 2008 Posts: 25
|
Posted: Fri Jan 16, 2009 4:54 pm Post subject: |
|
|
Still having trouble syncing data. This time it is a foreign key constraint. Here is the error:
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.
| Code: |
| DBSqlOptions.DropConstraintsAndIndexes| DBSqlOptions.DisableKeys|DBSqlOptions.ReseedIdentity|DBSqlOptions.UseTransactions |
I have set the provider.Options = session.Options. It is only syncing TABLE1, TABLE2 records are already identical.
Thanks |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group