Showing posts with label trigger. Show all posts
Showing posts with label trigger. Show all posts

Friday, March 23, 2012

Query using schema to determine if Trigger exists

Hi,

I would like to know if there's a query that can tell me whether or not a trigger exists!

Thanks!

Quote:

Originally Posted by Barno77

Hi,

I would like to know if there's a query that can tell me whether or not a trigger exists!

Thanks!




Returns list of trigger names from a specific database

select * from dbo.sysobjects where OBJECTPROPERTY(id, N'IsTrigger') = 1

Regards

Jim :)|||Thank you! This helped me!

Friday, March 9, 2012

query to detemine trigger status

I know how to retrieve the list of triggers in teh database.
Select * from sysobjects where xtype = 'TR'
What I want to know is how do i tell whether the trigger is disabled or
enabled. I would appreciate if anybody can help me this.
thanks
MB...and status&2048=2048
will tell you if it's disabled
Mohan wrote:

>I know how to retrieve the list of triggers in teh database.
>Select * from sysobjects where xtype = 'TR'
>What I want to know is how do i tell whether the trigger is disabled or
>enabled. I would appreciate if anybody can help me this.
>thanks
>MB
>
>|||Lookup the argument ExecIsTriggerDisabled for the meta-data function
OBJECTPROPERTY in SQL Server Books Online.
Anith