Created
April 19, 2011 19:00
-
-
Save max-mulawa/929277 to your computer and use it in GitHub Desktop.
DML Trigger Snippet 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use master; | |
GO | |
CREATE DATABASE TriggerDatabase; | |
GO | |
use TriggerDatabase; | |
GO | |
CREATE TABLE dbo.Customers | |
( | |
CustomerName Varchar(10) NOT NULL | |
) | |
GO | |
CREATE TRIGGER dbo.Customers_AfterDelete | |
ON dbo.Customers | |
AFTER DELETE | |
AS | |
BEGIN | |
PRINT 'After Delete' | |
END | |
GO | |
DELETE FROM Customers | |
WHERE 1=0 | |
GO | |
DROP TRIGGER dbo.Customers_AfterDelete | |
GO | |
--Results | |
--After Delete | |
--(0 row(s) affected) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment