I use CONTEXT_INFO
to skip triggers as such:
IF CONTEXT_INFO() = 0x676E6F7468692073656175746F6E RETURN
and in my PROC:
IF CONTEXT_INFO() IS NOT NULL SET @CONTEXT_INFO = CONTEXT_INFO() -- to restore later
SET CONTEXT_INFO 0x676E6F7468692073656175746F6E
How do you set it back to NULL if you needed to? SET CONTEXT_INFO = NULL
does not work. Am I missing something obvious?
Just use
SET CONTEXT_INFO 0x /*Gets padded with zeros when cast to binary(128)*/
You don't set it to NULL
. If you look at
select context_info
from sys.sysprocesses
You will see that it is not NULL
for any of the connections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With