Tuesday, March 28, 2017

SQL Server - what is each session doing? running? sleeping?



SELECT s.status, s.session_id, '################', * FROM sys.dm_exec_sessions s ORDER BY s.status;

The current Session is:

SELECT @@SPID;

It will always be running, or queries wont work.

No comments:

Post a Comment