What happened to sql_handle in sysprocesses?

  • In SQL Server 2000 you can monitor active processes by looking at the sql_handle column in sysprocesses.  In SQL Server 2005 BOL says sql_handle ...

    Represents the currently executing batch or object.

    In SQL 2000 a non-zero value in sql_handle indicated an active process.  You could not simply rely on the status column to check for an actively running process.  This is not the case in 2005.  I ran a profiler trace to confirm that just because sql_handle reports a non-zero value does not mean the corresponding process is active.  Does anyone know why this has changed and how we are now to interpret sql_handle in 2005?

    Thanks,   Dave

  • sysprocesses is supplied as a backward compatible view in terms of "columns" the behaviour of many of those "compatibility views" have changed and you are adviced in BOL to use :

    sys.dm_exec_connections

    sys.dm_exec_sessions

    sys.dm_exec_requests

    instead of sysprocesses. I know that the text is an exact copy of the 2000 version of BOL so I am guessing this is a Copy+Paste Bug in 2005 BOL


    * Noel

  • That makes sense.  Time to update my code.  Thanks

  • Believe me I have been bitten by these "compatibility views" already many times specially with sysindexes.

    Have fun with the upgrade


    * Noel

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

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