Re: add FK constraint with nocheck

From: Ray Higdon (sqlhigdon_at_nospam.yahoo.com)
Date: 03/17/04


Date: Wed, 17 Mar 2004 05:53:06 -0500

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 ?
>


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)
  • 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)
  • Re: add FK constraint with nocheck
    ... >Nocheck will ignore what is existing in your tables, ... >> I want to drop FK constraints while I do mass delete ... >> And then when deletions are done I have to set back. ... >> the PK in parent tables? ...
    (microsoft.public.sqlserver.mseq)