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 Test a DML Trigger in MS SQL Server?
Submitted by: AdministratorTo test a DML trigger defined on a table, you just need to execute several INSERT, UPDATE and DELETE statements on that table as shown in this tutorial example:
USE GlobalGuideLineDatabase;
GO
INSERT INTO ggl_users (name) VALUES ('GGL Admin');
GO
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
UPDATE ggl_users SET email='root@ggl'
WHERE name = 'GGL Admin';
GO
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
DELETE FROM ggl_users WHERE name = 'GGL Admin';
GO
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
The trigger, dml_message, is working as expected.
Submitted by: Administrator
USE GlobalGuideLineDatabase;
GO
INSERT INTO ggl_users (name) VALUES ('GGL Admin');
GO
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
UPDATE ggl_users SET email='root@ggl'
WHERE name = 'GGL Admin';
GO
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
DELETE FROM ggl_users WHERE name = 'GGL Admin';
GO
Records are inserted, updated, or deleted in ggl_users
(1 row(s) affected)
The trigger, dml_message, is working as expected.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.