Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Simple big question

Author  Topic 

zakwithu
Starting Member

8 Posts

Posted - 2009-09-30 : 05:32:18
Hi All,
I know how to enable/disable triggers. just use this code like this:
ALTER TABLE YourTable DISABLE TRIGGER ALL
and
ALTER TABLE YourTable ENABLE TRIGGER ALL


but how i know the trigger state is its enabled or disabled?

is there any sys variable contains this information?

thx,

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-30 : 05:39:30
SELECT OBJECTPROPERTY(OBJECT_ID('trigger_name'), 'ExecIsTriggerDisabled')


If the result is 1, it is disabled else enabled

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

zakwithu
Starting Member

8 Posts

Posted - 2009-09-30 : 05:52:46
quote:
Originally posted by madhivanan

SELECT OBJECTPROPERTY(OBJECT_ID('trigger_name'), 'ExecIsTriggerDisabled')


If the result is 1, it is disabled else enabled

Madhivanan

Failing to plan is Planning to fail



thank you it works fine
Go to Top of Page
   

- Advertisement -