Collections:
Testing DML Triggers in SQL Server
How To Test a DML Trigger in SQL Server?
✍: FYIcenter.com
To 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 FyiCenterData;
GO
INSERT INTO fyi_users (name) VALUES ('FYI Admin');
GO
Records are inserted, updated, or deleted in fyi_users
(1 row(s) affected)
UPDATE fyi_users SET email='root@fyicenter'
WHERE name = 'FYI Admin';
GO
Records are inserted, updated, or deleted in fyi_users
(1 row(s) affected)
DELETE FROM fyi_users WHERE name = 'FYI Admin';
GO
Records are inserted, updated, or deleted in fyi_users
(1 row(s) affected)
The trigger, dml_message, is working as expected.
⇒ sys.triggers - Listing All Triggers in the Database in SQL Server
⇐ "CREATE TRIGGER" - Creating a DML Trigger in SQL Server
2016-10-25, 2343🔥, 0💬
Popular Posts:
How To Query Tables and Loop through the Returning Rows in MySQL? The best way to query tables and l...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
How REAL and FLOAT Literal Values Are Rounded in SQL Server Transact-SQL? By definition, FLOAT(n) sh...
Where Is the Export Dump File Located in Oracle? If you are not specifying the dump directory and fi...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...