See what caused the start of SQL?

I'm just wondering if it is possible to see which stored procedure or SQL statement was made to trigger the trigger somewhere in the trigger.

I have a really strange error when the field has changed, and I can’t understand why this is happening. I have a trigger that registers that the data has been changed, but it would be great if I could also register which sql statement caused the field to change.

Is it possible?

+3
source share
2 answers

, OBJECT_NAME (@@Procid) . @@SPID .

+1

Source: https://habr.com/ru/post/1716423/


All Articles