Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Posts
    229

    Unanswered: Sysobject status value for foreign keys

    Tried first to post this as a follow-up to an old posting but it didn't seem to work. Anyway;
    I need to temporarily disable all constraints before running a DTS job that copies data. Rather than dropping all constraints and re-creating them after the DTS job has completed, I've thought about doing a ALTER TABLE NOCHECK CONSTRAINT ALL on the concerned tables before running DTS. But, I've noticed that if the Status (in Sysobjects) for a Foreign Key on the table is 2 before the ALTER, it's 2050 after I've done a final ALTER TABLE CHECK CONSTRAINT ALL, not 2. (It's 2306 while the NOCHECK is in effect.) Anybody who knows the difference between 2 and 2050? sp_helpconstraint says Enabled in both cases, and I can't see any other difference there.

  2. #2
    Join Date
    Jul 2002
    Posts
    229
    Answer found - 2050 corresponds to an ObjectProperty CnstIsNotTrusted = 1, i.e. constraint was enabled without checking for existing rows. (That flag is set to 1 already at NOCHECK time, by the way, for some reason.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •