What is the use of @@SPID?

Last updated:9/17/2020 7:12:16 PM

1 Answers

MindStick Software Pvt Ltd
MindStick Software Pvt Ltd

@@SPID
  • The @@SPID returns the session ID of the current user process.
  • The SQL @@SPID is one of the Configuration Function, which will return the session ID that is currently being used. Syntax behind this is -
@@SPID

Example

SELECT @@SPID AS 'SP ID', 

       SYSTEM_USER AS 'Login Name',
       USER AS 'User Name';

Answer