The T-SQL @@SPID function get the session ID of the current user process.
@@SPID Syntax
@@SPID;
@@SPID Example
SELECT @@SPID AS 'ID', SYSTEM_USER AS 'Login_Name', USER AS 'User_Name';
ID | Login_Name | User_Name |
---|---|---|
55 | work_pc\david | dbo |
See also:
T-SQL Functions ->
@@LOCK_TIMEOUT