sql server - How do you access the Context_Info() variable in SQL2005 Profiler? -


I am using the Context_Info () variable to keep a track of the user who executes a stored procedure and free-form SQL Has been doing. When every problem is solved on this server, I would like to be able to bring the context_info () variable and the value of the filter based on it.

When you set context_info () to output the trace values, user_conceptible events sp_trace_generateevent (EventId) Of 82-91). Your choice is to either, or context_info () is to find out the statements that will set you will not be able to get the price in any other way unless you dump the output of sys.dm_exec_sessions in a lip When a trace is running:

  select session_id, cast (Context_info varchar (128)) as context_info from sys.dm_exec_sessions where session_id & gt; User session for SQL 2000  

You can use sysprocesses:

  select spid, cast (reference_ology as varchar (128) ) From sysprocesses context_info where sid & gt; 50 - User Sessions  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -