Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the relationship between a SPID and a Connection in SQL server?

Can a SPID be used by two connections, while both connections are open?

If a connection is returned to a connection pool, will it hold on to the SPID?

like image 965
Shiraz Bhaiji Avatar asked Apr 30 '10 06:04

Shiraz Bhaiji


1 Answers

Can a SPID be used by two connections, while both connections are open?

No, each open connection will have its own SPID.

If a connection is returned to a connection pool, will it hold on to the SPID?

Yes, as long as the connection is open, it will be associated with one SPID.

You can test this yourself by querying sys.sysprocesses. Rebooting a client machine should clear its connection pool.

like image 50
Andomar Avatar answered Sep 23 '22 16:09

Andomar