TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How To Disable All Triggers on a Database
Nipun Tomar
Mar 29, 2012
11.4
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
Here are the queries that will help in disabling the triggers:
To enable & disable all the triggers and constraints we have a system defined Stored Procedure which are as under:
1) Disable all the triggers for a single database:
USE
AdventureWorks
;
GO
DISABLE
TRIGGER
Person
.
uAddress
ON
AdventureWorks
;
GO
2) Disable all the triggers for all servers:
USE
AdventureWorks
;
GO
DISABLE
TRIGGER
ALL
ON
ALL
SERVER
;
GO
3) Disabling all Constraints
exec
sp_MSforeachtable
ALTER
TABLE
?
NOCHECK
CONSTRAINT
ALL
4) Disabling all Triggers
exec
sp_MSforeachtable
ALTER
TABLE
?
DISABLE
TRIGGER
ALL
5) Enabling all Constraints
exec
sp_MSforeachtable
ALTER
TABLE
?
CHECK
CONSTRAINT
ALL
6) Enabling all Triggers
exec
sp_MSforeachtable
ALTER
TABLE
?
ENABLE
TRIGGER
ALL
For more detail plz read:
http://msdn.microsoft.com/en-us/library/ms189748.aspx
How To Disable All Triggers on a Database
Next Recommended Reading
Write DataBase Data to PDF File