February 8, 2003 at 8:19 am
Hi everyone,
Does anyone know how to find out if a trigger is enabled or disabled?
Thanks a lot
Johnny
February 8, 2003 at 5:50 pm
Check the status column of the trigger in sysobjects, something like this:
--will return if enabled, d_delete is the trigger name
select * from sysobjects where name='d_delete' and xtype='tr' and status & 2048 = 0
Andy
February 10, 2003 at 3:26 pm
Thanks Andy!
And I presume if it is disabled,
select * from sysobjects where name='d_delete' and xtype='tr' and status & 2048 = 1
February 10, 2003 at 3:56 pm
Here is another way:
select OBJECTPROPERTY ( object_id('pubs.dbo.employee_insupd'),'ExecIsTriggerDisabled')
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
Gregory A. Larsen, MVP
February 10, 2003 at 6:48 pm
Better answer than mine!
Andy
February 11, 2003 at 7:48 am
Thank you Greg!
Great website as well!! I guess I will go with your solution.
Thank you also Andy.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply