SPID SqlConnection (SQL-Server) in ADO.NET

Can I get the SPID from a SqlConnection object (SQL-Server database) in ADO.NET ?

Is the SPID always the same for the connection object during its lifetime?

+5
source share
1 answer

select @@SPID gives you spid.

It should be permanent, but can be recycled if you have a connection pool.

+4
source

All Articles