DTS Failure (fk constraint)

  • I tried to do a simple DTS transfer. It failed because of foreign key constraints.

    I notice that all relationships have "enforce for replication" ticked, and I presume that this is the reason why my DTS transfer failed.

    Is there a TSQL script (or some other way) that will un-select the "enforce for replication" option for ALL the relationships in the database without having to do each one individually using Enterprise manager ?

    Thanks.

  • You'll need to add an Execute SQL Task to your DTS package that disables or drops the FK constraints i.e. ALTER TABLE with CHECK/NOCHECK CONSTRAINT. Here's a script to enable & disable all the constraints & triggers in a database: http://www.sqlservercentral.com/scripts/contributions/25.asp

    and another that lists the FK constraints in a hierarchy: http://www.sqlservercentral.com/scripts/contributions/445.asp

    Greg

  • thanks greg

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply