Returns the type or types of triggers defined on the specified table for the current database.
sp_helptrigger [@tabname =] 'table'
[,[@triggertype =] 'type']
Value | Description |
---|---|
DELETE | Returns DELETE trigger information. |
INSERT | Returns INSERT trigger information. |
UPDATE | Returns UPDATE trigger information. |
0 (success) or 1 (failure)
Column name | Data type | Description |
---|---|---|
trigger_name | sysname | Name of the trigger |
trigger_owner | sysname | Name of the trigger owner |
isupdate | int | 1 = UPDATE trigger 0 = Not an UPDATE trigger |
isdelete | int | 1 = DELETE trigger 0 = Not a DELETE trigger |
isinsert | int | 1 = INSERT trigger 0 = Not an INSERT trigger |
Execute permissions default to the public role.
This example creates a trigger named sales_warn that raises error 50010 when the amount of books sold is 10. Then, sp_helptrigger is executed to produce information about the trigger(s) on the sales table.
USE pubs
CREATE TRIGGER sales_warn
ON sales
FOR INSERT, UPDATE
AS RAISERROR (50010, 16, 10)
EXEC sp_helptrigger sales
Here is the result set:
trigger_name trigger_owner isupdate isdelete isinsert
------------- ----------------------- ----------- ----------- ---------
sales_warn dbo 1 0 1
(1 row(s) affected)
ALTER TRIGGER | DROP TRIGGER |
CREATE TRIGGER | System Stored Procedures |