Viewing a Trigger

Creating and Maintaining Databases

Creating and Maintaining Databases

Viewing a Trigger

In Microsoft® SQL Server™ 2000, you can determine the types of triggers on a table, the name of the trigger, its owner, and the date it was created.

You can also:

  • Gain information about the definition of a trigger if it was not encrypted when created or modified. You may need to see the definition of the trigger to see its Transact-SQL statements or to understand how it affects the table upon which it is defined.

  • List the objects used by the specified trigger. This information can be used to identify the objects that affect the trigger if they are changed or deleted in the database.

The result set of sp_helptrigger contains the columns isafter and isinsteadof to report whether a trigger is an AFTER or INSTEAD OF trigger. The OBJECTPROPERTY function reports whether a trigger is an AFTER or INSTEAD OF trigger through the ExecIsInsteadOfTrigger and ExecIsAfterTrigger properties.

To view the types of triggers on a table

Transact-SQL

SQL-DMO

To view information about a trigger

Transact-SQL

SQL-DMO

To view a trigger

Transact-SQL