Provides information about current SQL Server users and processes. The information returned can be filtered to return only those processes that are not idle.
For additional syntax information for sp_who, see the Microsoft SQL Server Transact-SQL Reference.
sp_who [login_name | 'spid' | active]
where
For more information about blocking, see the Microsoft SQL Server Administrator's Companion.
This procedure reports information about a specific user, a specified SQL Server process, all users currently running a process, or all active processes. Executing sp_who without parameters reports which users are running what processes in all databases.
sp_who active
sp_who '10' --specifies the process_id
Execute permission defaults to the public group.