SQL Bulk copy with referential integrity

sqlbulkcopy

Question

My requirement is to be able to bulk insert data to multiple table. (Having foreign key constraints) I won't get the foreign keys till I submit the batch to the parent table. how to achieve this using bulk copy? i cannot use linked servers or openrowset due to policy constraints.

Popular Answer

you may be able to get away with turning off the constraints temporarily during the bulk load.



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why