Questions tagged [set-context-info]

Associates up to 128 bytes of binary information with the current session or connection.

Multiple active result sets (MARS) enables applications to run multiple batches, or requests, at the same time on the same connection.

When one of the batches on a MARS connection runs SET CONTEXT_INFO, the new context value is returned by the CONTEXT_INFO function when it is run in the same batch as the SET statement.

The new value is not returned by the CONTEXT_INFO function run in one or more of the other batches on the connection, unless they started after the batch that ran the SET statement completed.

Official documentation and examples

5 questions
1
vote
0 answers

Context_info value is null in trigger

I want to get some value in trigger when its start executing. However getting the value using parameter option is not available in trigger. So I decided to store that particular value in one variable and pass it to Context_info in my stored…
1
vote
1 answer

How to store and extract number from binary field?

I have a procedure that is doing INSERT/DELETE operations over table and a trigger which is logging the changes in second table. What I need is to pass the security user id that instantiated the procedure call to the trigger in order to record who…
gotqn
  • 42,737
  • 46
  • 157
  • 243
0
votes
0 answers

spring boot set requestid in database

If I want to set a DBMS property when a transaction is started in the database... how Do I do that! What I want to do (for example in SQL Server) is set context_info 0xSome-binary-value-for-a-requestId What this will give me: Tracability on the…
0
votes
0 answers

How to set countext_info with linked server connection

I am connecting to a server with linked server (I call this server customerServer) , I must set context info before exec a sp in CustomerServer...but I can't set context info by linkserver....what shoud I do? this is the Context_infi and the…
0
votes
0 answers

How to get value inside trigger

i'm running my application using one DB but during some specific table insertion i'm calling trigger where i need to get some value from some another DB.Previously i did this by hard coding the specific DB name inside the trigger. i got it correctly…