June 14, 2010 at 7:01 am
I ran sp_who2, what is SPID?
From Microsoft, I found that it is session ID.(I copied it at bottom).
I used ASP.NET in app, what is the relationship between SPID and connection string? Is it processing ID?
-------------
session ID (SPID in SQL Server 2000 and earlier) is a session identification number belonging to the SQL Server instance. session ID is smallint.
June 14, 2010 at 7:16 am
That is the Process Id that indicates the processes SQL engine uses for completing tasks.
For example if you run a query it may be done by a single process than you will see one process.
Or it may be distributed over many processes according to parallel computing capabilities and configuration of the SQL Server, then you will see more than one process id.
Generally you will not deal with spid's.
It is only checked if one process is blocking other, etc.
June 14, 2010 at 7:43 am
It's the identifier for a connection. There is no relation to the connection string or to any machine connecting to the server, except for the duration of the connection. You're not guaranteed a session id and you may or may not see them repeated for a given connection. It's largely arbitrary and internal.
They're very useful for tracking a transaction, what's running, what's running long, is it blocking or blocked by other sessions, was it a victim in a deadlock... Again, very useful, but primarily concerned with internals.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply