February 20, 2006 at 8:25 pm
How can we set Session specific Global Variable in SQL SERVER 2005.
Is there any concept of Global Variables?
I know about the Global Temp table. I am more concern for Global Variables.
Immediate response will be highly appreciated.
Regards
Chandrashekhar
February 22, 2006 at 11:50 am
There is, in fact, a mechanism to do what you need (though it is not in the most convenient format ever): Session Context information. To quote from BoL:
Session context information enables applications to set binary values of up to 128 bytes that can be referenced in multiple batches, stored procedures, triggers, or user-defined functions operating on the same session. You can set a session context value by using the SET CONTEXT_INFO statement and retrieve it by using one of the following:
This is new, and something I didn't know before I went to try and answer your question. Thanks - now we both know something new.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply