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;
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>>
VIEW SERVER STATE
As per the relevant MSDN pages for the Dynamic Management Views: One, Two
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With