SPID和SQL Server中的连接之间有什么关系?

问题描述:

两个连接都打开时,两个连接都可以使用SPID吗?

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

如果将连接返回到连接池,它将保留在SPID上吗? ?

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


两个连接都可以使用SPID,而两个连接都可以使用

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

否,每个打开的连接都有其自己的SPID。

No, each open connection will have its own SPID.


如果将连接返回到
连接池,它将保留
的SPID吗?

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

是的,只要连接打开,它将与一个SPID关联。

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

您可以通过查询 sys.sysprocesses 。重新启动客户端计算机应清除其连接池。

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