Timeline for How to prevent a trigger from running on certain statements?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 8, 2015 at 13:55 | answer | added | Geoff Patterson | timeline score: 1 | |
Jun 6, 2015 at 18:00 | answer | added | RolandoMySQLDBA | timeline score: 1 | |
Jun 6, 2015 at 14:31 | comment | added | Dan Guzman |
In SQL Server, one method to bypass a trigger is to create a tempdb table before the DML and short-circuit execution within the trigger if the temp table exists. Another is to use set and get CONTEXT_INFO within the trigger. Both these methods would avoid adding a column to the table.
|
|
Jun 6, 2015 at 2:30 | history | edited | Logarr | CC BY-SA 3.0 |
added 199 characters in body
|
Jun 5, 2015 at 23:16 | comment | added | ypercubeᵀᴹ |
SQL-Server has statement based triggers, MySQL has only row based ones. SQL-Server has INSTEAD OF and AFTER triggers, MySQL has BEFORE and AFTER . There are numerous other differences that make the chance of writing a trigger that works in both platforms, almost 0. having said that, your idea of an extra column (or something else that someone else may come up with) may work for both worlds - but the implementation details will differ.
|
|
Jun 5, 2015 at 22:54 | comment | added | Aaron Bertrand | You're simply not going to get a trigger that works on both platforms, you need two different answers. | |
Jun 5, 2015 at 22:32 | review | First posts | |||
Jun 5, 2015 at 23:06 | |||||
Jun 5, 2015 at 22:31 | history | asked | Logarr | CC BY-SA 3.0 |