context-info

What is the scope of CONTEXT_INFO in SQL Server?

I am using CONTEXT_INFO to pass a username to a delete trigger for the purposes of an audit/history table. I'm trying to understand the scope of CONTEXT_INFO and if I am creating a potential race condition. Each of my database tables has a stored proc to handle deletes. The delete stored proc takes userId as an parameter, and sets CON...

Why context_info can fail?

I am using context_info to simulate a global variable, I use it in this context. I have scripts made up of several batches, I set a global variable at the beginning (123 in the example) and then after all the batches I use that number to populate a log table. Now this works, but today it failed on one machine, I cannot figure why. Is t...