|
Answer» Well there are many ways to do this.
- find the SPID which you want to analyze. An spid is assigned as soon as a client connection is established with the SQL server. To find the spid you can run any of the FOLLOWING command:
- SP_WHO2 ‘ACTIVE’ — This will give you only active spids.
- SELECT * FROM sys.dm_exec_requests
- Get the spid from above TWO QUERIES and use any of the following query to get what is happening behind that spid.
- dbcc inputbuffer()
- sql2005 and sql2008 – SELECT * FROM sys.dm_exec_sql_text()
- sql2005 and sql2008 – SELECT * FROM fn_get_sql()
Well there are many ways to do this.
|