3

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;

3
  • please tell me what is chatspeak ?
    – Chani
    Commented Jun 1, 2011 at 12:07
  • cos instead of because, etc Commented Jun 1, 2011 at 12:30
  • It isn't that we don't have a sense of humor, or that we want you to type a lot. But we discourage chatspeak because it is already difficult enough for people whose native language is not English to understand what we are saying here. Slang just makes it harder.
    – DOK
    Commented Jun 1, 2011 at 12:39

3 Answers 3

4

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>>
1

VIEW SERVER STATE

As per the relevant MSDN pages for the Dynamic Management Views: One, Two

-1

i hope you are using Debug instead of Execute(F5).

1
  • How is this answer relevant please?
    – gbn
    Commented Jun 1, 2011 at 13:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.