Status of trigger state.

  • Is there any place within the system tables where there is a column that can be looked inot to find the status of trigger if its enabled or disabled. Would very much appriciate if some one could post the actual script to look at the status of triggers. Though i did look at the sysobjects.status column which has numbers which make no sense to me as i am not able to relate the numbers to any explaination.

  • I just use the objectproperty(object_id(),'ExecIsTriggerDisabled')

    Returns a 1 if the trigger is disabled.

    ie: select objectproperty(object_id('r_CLNUMCOPY_i'),'ExecIsTriggerDisabled')

  • Try, not completed :

    Select Name As TableName,

    Case When DelTrig<>0 Then IsNull(Objectproperty(DelTrig,'ExecIsTriggerDisabled'),'') Else '' End as DeleteTriggerDisabled,

    Case When instrig<>0 Then IsNull(Objectproperty(instrig,'ExecIsTriggerDisabled'),'') Else '' End as InsertTriggerDisabled,

    Case When updtrig<>0 Then IsNull(Objectproperty(updtrig,'ExecIsTriggerDisabled'),'') Else '' End as UpdateTriggerDisabled,

    Case When seltrig<>0 Then IsNull(Objectproperty(seltrig,'ExecIsTriggerDisabled'),'') Else '' End as SelectTriggerDisabled

    From SysObjects

    Where XType='U' And

    (deltrig<>0 or

    instrig<>0 or

    updtrig<>0 or seltrig<>0)

    Order by Name

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply