Today I ran into something I haven't seen before. I think it's actually a bug, but I figured I'd ask if anyone else has seen this before.
The SPID displayed in the status bar of one of my query windows doesn't match the result of SELECT @@SPID
executed in that window. See screenshot in link below (note that username and server name edited out with red blocks for privacy). Status bar says "158", but SELECT @@SPID
returns "168".
In the past I have always relied on the SPID in the status bar if I have to kill one of my processes, but now I am worried that I can not rely on them.
I have no idea how it happened; I wasn't doing anything unusual. I just was running a query I've run many times in the past, went to check on what else was running on the server with sp_whoisactive. Then I noticed the SPID in the output of sp_whoisactive for my query was 168, which didn't match the 158 I was seeing in the status bar. I returned to the window labeled 158 and ran SELECT @@SPID
just to make sure it wasn't just an issue with the sp_whoisactive procedure, and sure enough it was 168 as well.
Has anyone else run into this before? Are there times when these numbers are known to be different? Any ideas of where the "158" could have originated from?
I'm using
Microsoft SQL Server 2016 Enterprise SP1: Core-based Licensing (64-bit) Version 13.0.4411.0
by the way. Any help would be appreciated. Thanks!