Re: add FK constraint with nocheck

From: Norman (anonymous_at_discussions.microsoft.com)
Date: 03/17/04

  • Next message: Rishi: "Re: How to limit the number of sql statements ?"
    Date: Wed, 17 Mar 2004 05:59:41 -0800
    
    

    Thank you !
    I tested and there was a working FK constraint.

    >-----Original Message-----
    >Nocheck will ignore what is existing in your tables, any
    new data will be
    >checked by the constraint
    >
    >--
    >Ray Higdon MCSE, MCDBA, CCNA
    >---
    >"Norman" <anonymous@discussions.microsoft.com> wrote in
    message
    >news:136c01c40bff$a7376d10$7d02280a@phx.gbl...
    >> I want to drop FK constraints while I do mass delete
    from
    >> tables which has several steps relationships.
    >> And then when deletions are done I have to set back.
    >> In the tables even after the deletion there are over 300
    >> million posts.
    >> So, I want to add FK constraints with nocheck so that
    SQL
    >> server doesn't check existing data.
    >> But what happens when new data is added ?
    >> Do these FK constraints added as with nocheck will check
    >> the PK in parent tables ?
    >> Anyone know how "add FK constraint with nocheck"
    exactly
    >> works ?
    >>
    >
    >
    >.
    >


  • Next message: Rishi: "Re: How to limit the number of sql statements ?"

    Relevant Pages

    • Re: Delete query taking long time to execute
      ... I have asked him to do the NOCHECK when the system is offline (No users ... constraints [See ALTER TABLE WITH NOCHECK] to make the DELETE faster. ...
      (microsoft.public.sqlserver.mseq)
    • Re: TSQL - Alter table to add a clustered prime key index
      ... You can not have two constraints in a single definition (Check and Primary ... Wayne Snyder, MCDBA, SQL Server MVP ... > ALTER TABLE USERS WITH NOCHECK ADD CONSTRAINT PK_USERS CHECK USERCODE ...
      (microsoft.public.sqlserver.programming)
    • Re: add FK constraint with nocheck
      ... Nocheck will ignore what is existing in your tables, ... "Norman" wrote in message ... > And then when deletions are done I have to set back. ... I want to add FK constraints with nocheck so that SQL ...
      (microsoft.public.sqlserver.mseq)
    • add FK constraint with nocheck
      ... I want to drop FK constraints while I do mass delete from ... And then when deletions are done I have to set back. ... I want to add FK constraints with nocheck so that SQL ...
      (microsoft.public.sqlserver.mseq)
    • Re: Timeouts
      ... > This column is on the primary data file, which is where all the rest ... I don't think you need a fill factor on the clustered index ... Second, unless you really need it, get rid f the WITH NOCHECK on the PK. ... "Constraints defined WITH NOCHECK are not considered by the query ...
      (microsoft.public.sqlserver.server)