There is very useful system stored procedure called sp_who on Sql server that lists users and processes running on the system. It comes handy when you want to see if any process is blocked. Both sp_who and sp_who2 provides information about the current processes / sessions / users in sql server instances. sp_who2 provides some more information as compare to the sp_who.
SP_WHO : SP_WHO provides information like logged in user id, session id, host name ,session status, blocking process details , database name etc.
SP_WHO2 : SP_WHO2 provides some more information - CPU time for each session, Disk IO, Last Batch , Program name.
As such there is no difference in both SPs but the major one is that SP_WHO2 is not a documented it is an undocumented stored procedure.
Above two SPs can be used to monitor the server connections. Also these can be used to check the connections created for specific login/specific session /active session. You can filter the data returned to show only those processes that are not idle. if you specify a particular user like sp_who [@login_name=]'Login' then you get processes for that user , otherwise all processes for all users will be listed .
No comments:
Post a Comment