Constraints causing package failure

  • A part of a daily DTS package reloads an entire table.  Prior to loading, I set the NOCHECK for constraints, using ALTER TABLE tbl1 NOCHECK CONSTRAINT ALL.

    However, when the table reloads it contains zero rows.  I suspect that the PK constraint prevents the table from loading.  When I drop the PK constraint and reload the table, it contains the appropriate number of rows.  I perform other SQL tasks to eliminate the duplicate rows later.  Can anyone please clarify the ALTER TABLE statement to basically turn off constraints? Thank you.

  • BOL:

    "The WITH CHECK and WITH NOCHECK clauses cannot be used for PRIMARY KEY and UNIQUE constraints."

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

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