Benutzer:MovGP0/SQL/Triggers

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen

List all Triggers[1]

[Bearbeiten | Quelltext bearbeiten]
SELECT 
     sysobjects.name AS trigger_name 
    ,USER_NAME(sysobjects.uid) AS trigger_owner 
    ,s.name AS table_schema 
    ,OBJECT_NAME(parent_obj) AS table_name 
    ,OBJECTPROPERTY( id, 'ExecIsUpdateTrigger') AS isupdate 
    ,OBJECTPROPERTY( id, 'ExecIsDeleteTrigger') AS isdelete 
    ,OBJECTPROPERTY( id, 'ExecIsInsertTrigger') AS isinsert 
    ,OBJECTPROPERTY( id, 'ExecIsAfterTrigger') AS isafter 
    ,OBJECTPROPERTY( id, 'ExecIsInsteadOfTrigger') AS isinsteadof 
    ,OBJECTPROPERTY( id, 'ExecIsTriggerDisabled') AS [disabled] 
FROM sysobjects

<references> [1]

  1. a b Need to list all triggers in SQL Server database with table name and table's schema. In: stackoverflow. Abgerufen am 2. März 2015 (englisch).