T-SQL Tutorial

T-SQL @@SPID function


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';

IDLogin_NameUser_Name
55work_pc\daviddbo

See also:
T-SQL Functions -> @@LOCK_TIMEOUT