T-SQL Tutorial

T-SQL Sp_who


On Transact SQL language the sp_who is part of Database Engine Stored Procedures and shows information about current users, sessions and processes.

Sp_who syntax:

sp_who [ [ @loginame = ] 'login' | session ID | 'ACTIVE' ] ;





List all processes:

USE model;
GO
EXEC sp_who;
GO

List active processes:

USE model;
GO
EXEC sp_who 'active';
GO