It’s like a context space for ants!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no way to increase the size of the CONTEXT_INFO. It is 128 bytes, and we cannot change it.
If you need more space, you could implement your own session context information. You could create a permanent ContextInfo or global ##ContextInfo or tempdb..ContextInfo table that holds all the data you neeed to track per session. Set the table’s primary key to something unique like an IDENTITY. You could also use the @@SPID of the current connection.
When a request is started, INSERT a record into this ContextInfo table (or lookup the existing record on the @@SPID), and SET CONTEXT_INFO to the associated key (or just use the @@SPID). After your connection is finished, clean up the ContextInfo table and clear the CONTEXT_INFO information.