active triggers

when i disbale a trigger, it still says enabled.. what am i doing wrong?
LVL 5
25112Asked:
Who is Participating?
 
Shaun KlineConnect With a Mentor Lead Software EngineerCommented:
You can try this code to disable all triggers on all tables:
EXEC sp_msforeachtable "ALTER TABLE ? DISABLE TRIGGER ALL"

(found at http://sqltidbits.com/scripts/disable-or-enable-all-triggers-table
and http://blog.namwarrizvi.com/?p=82)
0
 
25112Author Commented:

when i try the below code, i get 3 zero values
select distinct is_disabled from sys.triggers
GO
DISABLE Trigger ALL ON DATABASE
select distinct is_disabled from sys.triggers
GO
ENABLE Trigger ALL ON DATABASE
GO
select distinct is_disabled from sys.triggers

Open in new window

0
 
Shaun KlineLead Software EngineerCommented:
Are you trying to disable triggers on the database object or on table objects?
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
25112Author Commented:
all tables
0
 
Shaun KlineLead Software EngineerCommented:
The code you provided disables all triggers for the Database object. I do not believe it disables the triggers for the tables. For that, I believe you would need to run DISABLE TRIGGER for each table.
0
 
25112Author Commented:
works!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.