SPID stands for Server Process ID. SPID returns the session ID of the Current User Process.
In SQL server each session is identified by its own SPID.
If you get the SPID then you can get the running query and also possible to KILL the query.
SYNTAX
SELECT @@SPID
EXAMPLE
The following example provide you the clear idea about the Session ID of the session.
In the above example i have used the system function @@SPID to get the session ID.
It returns ID value as 55.
Without using the system function you can also get the Session ID at the bottom of the query window (Highlighted in Red Box)
This session ID will be helpful when you identifying the blocking queries in SQL server.
No comments:
Post a Comment