sp_help spid???

  • What is the command to see what a particular spid is executing?

    thanks!

  • I got it....

    DBCC INPUTBUFFER (spid)

  • DBCC INPUTBUFFER( <spid> ) tells you the last command issued.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • With sql sp3 you have another option:

    DECLARE @Handle binary(20)

    SELECT @Handle = sql_handle FROM sysprocesses WHERE spid = 52

    SELECT * FROM ::fn_get_sql(@Handle)

    See BOL for details.

  • Hi

    cannot get anything in BOL. COuld you please explain a bit..

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

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