• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

active triggers

when i disbale a trigger, it still says enabled.. what am i doing wrong?
0
25112
Asked:
25112
  • 3
  • 3
1 Solution
 
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
 
25112Author Commented:
all tables
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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
 
Shaun KlineLead 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:
works!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now