check triggers

  • How to check if there is a trigger on a table and the status of it.

    Please correct me if this is not the right way..

    I checked it by selecting the properties of the table --> Tasks-->Manage triggers .

    Again i checked by querying sp_help "table name"

    I did not find any triggers but iam not sure if there are any.

    Thanks

    Murali

  • I 'm sorry ... i noticed that i mistakenly posted it on 2005 topics but its about sql2000.

    Murali

  • hi murali,

    If you are using 2005, this is really easy:

    select object_name(parent_id) as table_name, name as trigger_name, is_disabled

    from sys.triggers

    For 2000, you can use:

    SELECT OBJECT_NAME (parent_obj), name,

    OBJECTPROPERTY (id, 'ExecIsTriggerDisabled') as is_disabled

    FROM sysobjects

    WHERE type = 'TR'

    let me know is it okay?

    thx

    sreejith

    MCAD

  • Sreejit

    Thanks for the reply . It worked but I did not understand why "is _disabled" is used ad the relevance of it...I tried with is_enabled in the query. I got the same output .

    Thanks

    Murali

  • Srijeet..I could make out what it is ..I found the triggers and also their status too.

    This query helped me and thanks once agian..

  • hi murali

    u r welcomw

    thx

    sreejith

    MCAD

Viewing 6 posts - 1 through 5 (of 5 total)

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