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

后端 未结 19 1003
再見小時候
再見小時候 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:58

    I had the same task recently and I used the following for sql server 2012 db. Use management studio and connect to the database you want to search. Then execute the following script.

    Select 
    [tgr].[name] as [trigger name], 
    [tbl].[name] as [table name]
    
    from sysobjects tgr 
    
    join sysobjects tbl
    on tgr.parent_obj = tbl.id
    
    WHERE tgr.xtype = 'TR'
    

提交回复
热议问题