Check triggers linked to a given table

0

I use the database Sql Server 2012 And the tool SQL Server Management Studio 2012

How can I check the triggers that are bound to certain tables without having to go through the object browser?

Is there any select or some function where I get the trigger X tabela relationships?

    
asked by anonymous 13.06.2017 / 21:51

1 answer

2

To check all Triggers in their respective table, you can use the query below:

Select 
    Object_Kind = 'Table',
    Sys.Tables.Name As Table_Name , 
    Sys.Tables.Object_Id As Table_Object_Id ,
    Sys.Triggers.Name As Trigger_Name, 
    Sys.Triggers.Object_Id As Trigger_Object_Id 
From Sys.Tables 
INNER Join Sys.Triggers On ( Sys.Triggers.Parent_id = Sys.Tables.Object_Id )
Where ( Sys.Tables.Is_MS_Shipped = 0 )
    
13.06.2017 / 22:00