Collections:
"ALTER TRIGGER" - Modifying Existing Triggers in SQL Server
How To Modify Existing Triggers using "ALTER TRIGGER" in SQL Server?
✍: FYIcenter.com
If 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 FyiCenterData;
GO
ALTER TRIGGER dml_message ON fyi_users
AFTER INSERT, UPDATE, DELETE
AS
PRINT 'Time: '+CONVERT(VARCHAR(12),GETDATE());
PRINT 'Records are inserted, updated,'
+ ' or deleted in fyi_users';
GO
UPDATE fyi_users SET email='john@fyicenter' WHERE id = 1;
GO
Time: Jul 1 2007
Records are inserted, updated, or deleted in fyi_users
An extra printing statement is added the trigger.
⇒ "DROP TRIGGER" - Deleting Existing Triggers in SQL Server
⇐ sys.triggers - Listing All Triggers in the Database in SQL Server
2016-10-24, 2187🔥, 0💬
Popular Posts:
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
What Is an Oracle Tablespace in Oracle? An Oracle tablespace is a big unit of logical storage in an ...
How To Download Oracle Database 10g XE in Oracle? If you want to download a copy of Oracle Database ...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
How To Get the Definition of a User Defined Function Back in SQL Server Transact-SQL? If you want ge...