Cannot execute the following sql query due to permission

What level of rights will I need to complete the next request?

SELECT S.*
FROM sys.dm_exec_requests R
INNER JOIN sys.dm_exec_sessions S
ON S.session_id = R.blocking_session_id

sys.dm_exec_sessions is a Dynamic Management view 

I get a message that it cannot start the debugger;

+3
source share
3 answers

In accordance with this very useful article :

These DM views are protected because they can display information that you most likely would not have for everyone.

Grant permission VIEW SERVER STATEfor server-level permissions and VIEW DATABASE STATEfor dynamic database management views and functions. It is usually best to create a role and then grant permissions to do so.

GRANT VIEW SERVER STATE TO <<login name>>
+4
source

View server status

MSDN Dynamic Management Views: ,

+1

, Debug Execute (F5).

-1

All Articles