Check the triggers linked to a given table

Asked

Viewed 810 times

0

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

How can I check the triggers which are linked to certain tables without having to go by the object explorer?

there is some select or some function where bring me relationships trigger X tabela?

1 answer

3


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 )

Browser other questions tagged

You are not signed in. Login or sign up in order to post.