SPId of Current Connection

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
RonBrisola
Posts: 14
Joined: Wed 14 Nov 2012 12:59

SPId of Current Connection

Post by RonBrisola » Wed 25 May 2022 19:43

Is it possible to retrieve the @@spid of the current connection of TSQLConnection?

My issue is this,
when I connect the database on my app for the first time I execute, on the event AfterConnect, SELECT @@spid to store the spid,
but if my network broke e gets online again after a few moments, the connection is reestablished, but with new @@spid, and the event AfterConnect is not triggered.

pavelpd
Devart Team
Posts: 109
Joined: Thu 06 Jan 2022 14:16

Re: SPId of Current Connection

Post by pavelpd » Thu 16 Jun 2022 04:41

Hi Ron,
Thanks for your request!

Please note, that the AfterConnect occasion is generated by the TSQLConnection component, not by our driver.
We cannot affect the TSQLConnection component.

Also, could you please describe in more details how you restore the connection?

Feel free to ask if you have any questions!

Post Reply