Nuta
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować się zalogować lub zmienić katalog.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Returns the session ID of the current user process.
Transact-SQL Syntax Conventions
Składnia
@@SPID
Return Types
smallint
Uwagi
@@SPID can be used to identify the current user process in the output of sp_who.
Examples
This example returns the session ID, login name, and user name for the current user process.
SELECT @@SPID AS 'ID', SYSTEM_USER AS 'Login Name', USER AS 'User Name';
Here is the result set.
ID Login Name User Name
------ ------------------------------ ------------------------------
54 SEATTLE\joanna dbo