April 6, 2007 at 11:56 am
Is there a way to view the SQL statement being ran by someone else? Sometimes a server can hang on an app running a statement on the SQL box and I would like to see what statement is making it hang.
Thanks.
Alex
April 6, 2007 at 12:09 pm
Use DBCC INPUTBUFFER. If you do not know the SPID responsible for the hang, you may want to either try to narrow the SPID down by reviewing sp_who2 output, or write code to loop through all current SPIDs and output DBCC INPUTBUFFER for each SPID.
April 6, 2007 at 12:10 pm
Keep in mind that this will only give you the very last statement. If you need to see more, you may need to run Profiler and try to capture everything that SPID has been doing.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply