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 Modify Existing Triggers using "ALTER TRIGGER"?
Submitted by: AdministratorIf you want to make changes to an existing trigger, you could use the "ALTER TRIGGER" statements to refine the trigger again. The tutorial exercise below shows you how to modify the trigger defined in a previous tutorial:
USE GlobalGuideLineDatabase;
GO
ALTER TRIGGER dml_message ON ggl_users
AFTER INSERT, UPDATE, DELETE
AS
PRINT 'Time: '+CONVERT(VARCHAR(12),GETDATE());
PRINT 'Records are inserted, updated,'
+ ' or deleted in ggl_users';
GO
UPDATE ggl_users SET email='john@ggl' WHERE id = 1;
GO
Time: Jul 1 2007
Records are inserted, updated, or deleted in ggl_users
An extra printing statement is added the trigger.
Submitted by: Administrator
USE GlobalGuideLineDatabase;
GO
ALTER TRIGGER dml_message ON ggl_users
AFTER INSERT, UPDATE, DELETE
AS
PRINT 'Time: '+CONVERT(VARCHAR(12),GETDATE());
PRINT 'Records are inserted, updated,'
+ ' or deleted in ggl_users';
GO
UPDATE ggl_users SET email='john@ggl' WHERE id = 1;
GO
Time: Jul 1 2007
Records are inserted, updated, or deleted in ggl_users
An extra printing statement is added the trigger.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.