Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How To Disable All Triggers on a Database
WhatsApp
Nipun Tomar
12y
11.6
k
0
0
25
Blog
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
Up Next
Write DataBase Data to PDF File
Ebook Download
View all
MongoDB Interview Q & A
Read by 922 people
Download Now!
Learn
View all
Membership not found