Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2006, 02:27 PM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do you suspend constraints?

Hi,

What T-SQL statement do you temporarily turn off a foreign key or other constraint, in order to move a bunch of data with a series of bulk INSERT statements?

Thanks!

 
Old July 28th, 2006, 10:33 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

-- Foreign Key Example
ALTER TABLE Sales.ContactCreditCard
    NOCHECK CONSTRAINT FK_ContactCreditCard_Contact_ContactID
-- Check Constraint Example
ALTER TABLE Person.Contact
    NOCHECK CONSTRAINT CK_Contact_EmailPromotion

David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com
 
Old July 31st, 2006, 12:16 PM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perfect. Thank you David.

Aaron






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to suspend code till Activex event is handled fossx VB How-To 1 June 1st, 2007 10:57 AM
Dropping constraints epp_b MySQL 2 September 12th, 2006 09:22 PM
Suspend Processing during Form Display echovue Access 2 November 17th, 2004 11:09 AM
Rules/Constraints dhay1999 SQL Server 2000 1 July 11th, 2004 01:50 PM
Tricks with Constraints ebsutherla SQL Server 2000 3 June 6th, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.