Reputation: 5165
What level of rights would i need to execute the following query ?
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 am getting an error saying that it cant start debugger;
Upvotes: 3
Views: 3407
Reputation: 32841
According to this very helpful article:
These DM Views are secured, since they might show information you'd rather not have available to everyone.
Grant the VIEW SERVER STATE
permission for server-level and VIEW DATABASE STATE
permissions for database-level Dynamic Management Views and Functions. It's usually best to create a Role and then grant the permissions to that.
GRANT VIEW SERVER STATE TO <<login name>>
Upvotes: 4