2012年3月22日星期四

any ways to check for triggers

Hi ,
Is there any SP commands to retireve all the triggers for the whole DB
instead of the sp_showtrigger which is only at the DB's table level ?
Can i actually use the syscomments table like this
select * from syscomments where text like 'Create trigger%' ?
or is there any other method ?
tks & rdgs
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200604/1One method:
SELECT
OBJECT_NAME(parent_obj) AS TableName,
name AS TriggerName
FROM sysobjects
WHERE type = 'TR'
Hope this helps.
Dan Guzman
SQL Server MVP
"maxzsim via droptable.com" <u14644@.uwe> wrote in message
news:5f3b73333e46b@.uwe...
> Hi ,
> Is there any SP commands to retireve all the triggers for the whole DB
> instead of the sp_showtrigger which is only at the DB's table level ?
> Can i actually use the syscomments table like this
> select * from syscomments where text like 'Create trigger%' ?
> or is there any other method ?
> tks & rdgs
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200604/1|||tk you
Dan Guzman wrote:[vbcol=seagreen]
>One method:
>SELECT
> OBJECT_NAME(parent_obj) AS TableName,
> name AS TriggerName
>FROM sysobjects
>WHERE type = 'TR'
>
>[quoted text clipped - 7 lines]
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200604/1|||This will give you the trigger code also
SELECT
sysobjects.name AS [Trigger Name],
SUBSTRING(syscomments.text, 0, 26) AS [Trigger Definition],
OBJECT_NAME(sysobjects.parent_obj) AS [Table Name],
syscomments.encrypted AS [IsEncrpted]
FROM
sysobjects INNER JOIN syscomments ON sysobjects.id = syscomments.id
WHERE
(sysobjects.xtype = 'TR')
Aneesh R
"maxzsim via droptable.com" <u14644@.uwe> wrote in message
news:5f3b73333e46b@.uwe...
> Hi ,
> Is there any SP commands to retireve all the triggers for the whole DB
> instead of the sp_showtrigger which is only at the DB's table level ?
> Can i actually use the syscomments table like this
> select * from syscomments where text like 'Create trigger%' ?
> or is there any other method ?
> tks & rdgs
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200604/1

没有评论:

发表评论