Can a KPID (as select kpid from master..sysprocesses
) be assumed to be globally and always unique?
(I've found that for my small sample set KPID(n+1) ~= KPID(n) + 65536
(2^16) but I want to know if I can assume, previous db connections kpid is unique, even if it's previous loginame and spid match a new loginame
and spid
)
Cheers.
BLT.
(Already answered) *B) Loginame: how can I get the loginame from a current spid? loginame
isn't a column in sysprocesses
, and I can't find any table other than sysobjects
that has a column with loginame
, and I can't programatically get the loginame
out of sp_who. Maybe the sql used to generate sp_who
would help..
Based on these docs KPID is unique within the machine. It may be unique within a cluster but this seems unlikely since it refers to an identifier within the underlying operating system.
Since it is only a 32bit value there is no way it can be globally unique.
Based on this glossary
Kernel Process ID Version: 11.0 and later
An Adaptive Server process identifier that remains unique over long periods of time.
The 'uniqueness' of the value has some sort of timeframe but it is not guaranteed.