Link to home
Start Free TrialLog in
Avatar of CMDAI
CMDAI

asked on

Mysql Update without triggering the trigger

Is it anyway possible to write an update query which would not activate the trigger on that table which is being updated?
 
Avatar of OP_Zaharin
OP_Zaharin
Flag of Malaysia image

- i don't think you can skip the trigger. the workaround is to disable the trigger for that table, run your update then enable it back when the update is completed:
ALTER TABLE tablename DISABLE TRIGGER ALL

- run your update operation.

- then enabled trigger back:
ALTER TABLE tablename ENABLE TRIGGER ALL
ASKER CERTIFIED SOLUTION
Avatar of CMDAI
CMDAI

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
- yes sorry about that. you need to disable it one by one and enabled it back. and thats the only way for 'not activating' the trigger while doing other processing.
Avatar of CMDAI
CMDAI

ASKER

MYSQL does not have this option but a workaround would be to put veriables to disable trigger in each trigger