![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Is there any way to find out what fired a trigger? I have AFTER INSERT trigger for example. I need to know that it was fired by a stored procedure, another trigger or simple insert statement. TIA, Blueman |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Triggers cannot be fired by anything but an operation that changes a row; in this an Insert statement. Now |
|
Translating the transaction log (-z) may reveal some |
#5
| |||
| |||
|
|
"Nick Elson [Sybase iAnywhere]" wrote in message news:4aae5870$1 (AT) forums-1-dub (DOT) .. Triggers cannot be fired by anything but an operation that changes a row; in this an Insert statement. Now Yes, of course. I wasn't so precise as I should be. I need to know what called an insert statement, that fires a trigger. In some cases I have triggers inserting rows into their own tables. This automatically fires the after insert trigger. So I need to know who inserted a row - a trigger (in that case I don't watnt to do anything) or a stored procedure (or an application) (in that case trigger should insert the second row and do a few another things). I thought that it's possible to read some stack or anything else to figure out what inserted the row. We have a lot of triggers to modify, so we want to do it well. Translating the transaction log (-z) may reveal some Yes, but we need that information while the server and applications are working, so log translation is not the solution. Regards, Blueman |
#6
| |||
| |||
|
|
Mind if I ask why so many triggers are involved? To me triggers that |
|
Another approach is to invert you trigger logic and make it into a |
|
I don't know of any 'reading the stack' approach available to you. |
![]() |
| Thread Tools | |
| Display Modes | |
| |