Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MS SQL Server Interview Question:
How To Disable Triggers using "DISABLE TRIGGER"?
Submitted by: AdministratorIf want to stop the execution of an existing trigger temporarily, you can use the "DISABLE TRIGGER" statement to disable it. The disabled trigger will be kept in the database.
If you want to resume the execution of a disabled trigger, you can use the "ENABLE TRIGGER" statement to enable it.
The tutorial exercise below shows you how to disable and enable triggers:
USE GlobalGuideLineDatabase
GO
-- disabling a trigger
DISABLE TRIGGER dml_message ON ggl_users;
GO
INSERT INTO ggl_users (name) VALUES ('MHI Gate');
GO
(1 row(s) affected)
-- enabling a trigger
ENABLE TRIGGER dml_message ON ggl_users;
GO
INSERT INTO ggl_users (name) VALUES ('Roy MHI');
GO
Time: Jul 1 2007
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
Submitted by: Administrator
If you want to resume the execution of a disabled trigger, you can use the "ENABLE TRIGGER" statement to enable it.
The tutorial exercise below shows you how to disable and enable triggers:
USE GlobalGuideLineDatabase
GO
-- disabling a trigger
DISABLE TRIGGER dml_message ON ggl_users;
GO
INSERT INTO ggl_users (name) VALUES ('MHI Gate');
GO
(1 row(s) affected)
-- enabling a trigger
ENABLE TRIGGER dml_message ON ggl_users;
GO
INSERT INTO ggl_users (name) VALUES ('Roy MHI');
GO
Time: Jul 1 2007
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.