In SQL administration, which command is used to enable or disable a database trigger in a schema (for example, to temporarily suspend firing and then re-enable it)?

Difficulty: Easy

Correct Answer: ALTER TRIGGER

Explanation:


Introduction / Context:
Database administrators often need to disable triggers temporarily for bulk loads or maintenance and then re-enable them. SQL dialects provide a direct command to change a trigger’s status without dropping and recreating it. This question focuses on identifying the correct command.


Given Data / Assumptions:

  • We are dealing with SQL DDL used to manage triggers.
  • Objective: enable/disable an existing trigger.
  • Vendor specifics vary, but the canonical verb is consistent.


Concept / Approach:
In widely used systems (e.g., Oracle, SQL Server), ALTER TRIGGER is used to change a trigger’s state or definition. Typical syntax includes ENABLE or DISABLE clauses. Other commands manage different objects: ALTER TABLE changes table metadata; ALTER DATABASE affects database-level settings; “MODIFY TRIGGER” is not the standard keyword in mainstream SQL dialects.


Step-by-Step Solution:
Identify the object: trigger.Select the corresponding DDL verb: ALTER TRIGGER … ENABLE/DISABLE.Exclude unrelated ALTER commands targeting tables or databases.


Verification / Alternative check:
Vendor docs confirm: Oracle uses ALTER TRIGGER … ENABLE/DISABLE; SQL Server supports ALTER TABLE … DISABLE TRIGGER or ALTER TRIGGER for logic changes—however, “ALTER TRIGGER” is the direct, object-specific command recognized for trigger state/definition management.


Why Other Options Are Wrong:

  • ALTER DATABASE / ALTER TABLE: Target different objects; not the direct trigger state command in general form.
  • MODIFY TRIGGER: Not standard SQL syntax.
  • All of the above: Overinclusive.


Common Pitfalls:
Confusing vendor-specific shortcuts (e.g., disabling triggers via ALTER TABLE in some systems) with the conceptual, object-specific command asked by the question.


Final Answer:
ALTER TRIGGER

More Questions from Database Systems

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion