Skip to content
 

Get Session ID

To get the session ID, simply use the intrinsic variable @@SPID:

SELECT @@SPID

The acronym for SPID means Server Process ID. It is synonymous with session.



Popular search terms:

One Comment

  1. Ben says:

    whenever I rebuild index on SQL 2008, my process is blocked by session id -2. I could not find where this process is.

    Need your assistance badly.

    Thanks.
    Ben

post a comment OR Post Your Question on our ASK! Community!