Need to list all triggers in SQL Server database with table name and table's schema

后端 未结 19 959
再見小時候
再見小時候 2020-11-28 17:12

I need to list all triggers in SQL Server database with table name and table\'s schema.

I\'m almost there with this:

SELECT trigger_name = name, trig         


        
19条回答
  •  旧巷少年郎
    2020-11-28 17:56

    You can also get the body of triggers as following:

    SELECT      o.[name],
                c.[text]
    FROM        sys.objects AS o
    INNER JOIN  sys.syscomments AS c
    ON      o.object_id = c.id
    WHERE   o.[type] = 'TR'
    

提交回复
热议问题