to disable :-
sp_msforeachtable 'alter table ? nocheck constraint all'
to enable it back run,
sp_msforeachtable 'alter table ? check constraint all'
manoj
-----Original Message-----
From: Sanu Abraham
[mailto:mssqldba-ezmlmshield-x80026468.[Email address protected]
Sent: Tuesday, June 29, 2004 9:10 AM
To: LazyDBA Discussion
Subject: Thanks in advance for your help
Hei Gurus,
Please tell me is it possible to disable all the foreign key constraints
in an SQL server database using a single SQL statement....
May be some thing like
SET CONSTRAINTS ALL DISABLED
And then to enable
SET CONSTRAINTS ALL ENABLED
Regards,
-Sanu
_____________________________________________________
CONFIDENTIALITY AND PRIVILEGE NOTICE
This electronic mail transmission and any attachment may contain
confidential and/or legally privileged information intended for
the named recipient(s) only. Any review, use, disclosure,
distribution, copying or action regarding the information contained
in this transmission and any attachment by an unnamed recipient is
strictly prohibited. Also, if you are not a named recipient,
please contact the sender immediately and permanently delete
this transmission and any attachment from your computer system.
Thank you.
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 6/25/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.711 / Virus Database: 467 - Release Date: 6/25/2004
MS Sql Server LazyDBA home page