Current SQL

  • Hello All!

    Armed with a spid, what statement can be run from QA to tell the last/current SQL statement attributable to that spid?

    Thanks!

    Allen

  • DBCC INPUTBUFFER(<SPID&gt

     

  • I was not aware if my statement will be changes to Wink

    DBCC INPUTBUFFER(51) -- SPID = 51

     

  • A job is executing on the Server.  I want to find out what statement is executing, knowing the spd for the job.

    DBCC INPUTBUFFER(<spid&gt will get me the SQL string that executes the code that constitutes the job.  Like:

    DECLARE @int INT

    EXEC dbo.usp_MyProc @int

    It will not give me the actual SQL statement that's currently executing inside the SP.  I should have had a trace on, but I do not.  I was wondering if there was anyway to tell what the statement was that was actually executing on the Server for the spid.

    Thanks!

    Allen

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply