Chani
Chani

Reputation: 5165

cannot execute the following sql query because of permission

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

Answers (3)

DOK
DOK

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

gbn
gbn

Reputation: 432261

VIEW SERVER STATE

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

Upvotes: 1

Navaneethan
Navaneethan

Reputation: 2225

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

Upvotes: -1

Related Questions