Getting "The user does not have permission to perform this action" error when accessing dm_exec_sql_text DMV
-
19 ноября 2010 г. 20:58
When I login to my SQL Azure database using Management Studio, I want to be able to run the following query to get SQL text for an active session:
select * from sys.dm_exec_sql_text(0x020000004D4F6005A3E8119F3DD3297095832ABE63E312F2)
I get the following error:
The user does not have permission to perform this action.
I see a lot of others that are able to query this DMV so why can't I?
Thanks,
Dean
Все ответы
-
20 ноября 2010 г. 18:38
Your login needs to have VIEW SERVER STATE permissions to execute this DMV. Check if it has.
Pradeep Adiga
My blog: http://www.sqldbadiaries.com

- Предложено в качестве ответа Ai-hua Qiu 29 ноября 2010 г. 7:51
- Помечено в качестве ответа Dave Robinson - SQL AzureMicrosoft Employee, Owner 31 марта 2011 г. 16:15
-
23 ноября 2010 г. 5:30
Hi,
As Pradeep’s said, the login requires VIEW SERVER STATE permission on the server. Please see:
sys.dm_exec_sql_text (Transact-SQL)
Thanks,
Ai-Hua Qiu
Constant dropping wears away a stone.

