Thursday, October 27, 2011

How to find the Triggers details in Database

We  can use the following query to find a list of  all the triggers along with trigger details in the specific database:

select
"Table"=P.Name,
"Trigger Name"=O.name,
"Trigger Date"=O.refdate,
"Defn"=CASE C.encrypted WHEN 0 THEN C.text ELSE '<< ENCRYPTED >>' END
from
syscomments C
INNER JOIN sysobjects O ON (C.id = O.id)
INNER JOIN sysobjects P ON (O.parent_obj = P.id)
where

O.xtype = 'TR'

No comments:

Post a Comment

SSRS - How to Parameterizing the SQL Query

We need to create separated dataset to handle the pre defined list in that dataset we will use simple select statement to define the li...