I'm trying to seed a blank database from the production db via the Import/Export wizard. How do I convince SQL Server to ignore Foreign Key violations?
thx
I'm trying to seed a blank database from the production db via the Import/Export wizard. How do I convince SQL Server to ignore Foreign Key violations?
thx
There is an option to "check constraints" on the OleDbDestination Component. unmark it and it will ignore the foreign keys.
I honestly don't like that option much, so I suggest these two other ways:
1) Always copy the tables on the "inverse" order of the key. For example, if you have a key from A to B, copy table B first and then table A
2) use a Exec SQL Task to disable the foreign keys with the NOCHECK CONSTRAINT
(example here) before copy and another to enable after copy