Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Azure VIEW DATABASE STATE permission denied in database 'master'

When I execute the following query:

SELECT * FROM sys.dm_io_virtual_file_stats(NULL, NULL)

I get the error:

Msg 262, Level 14, State 1, Line 4 VIEW DATABASE STATE permission denied in database 'master'. Msg 297, Level 16, State 1, Line 4 The user does not have permission to perform this action.

But I able to execute this query using the provisioned (by SQL Azure portal) administrator user.

I am unable to GRANT VIEW DATABASE STATE for master (using the provisioned administrator user) to any of the user I created, I get the following error: Grantor does not have GRANT permission.

Any ideas how to be able to execute the query

SELECT * FROM sys.dm_io_virtual_file_stats(NULL, NULL)

from a user other than the provisioned (by SQL Azure portal) administrator user?

like image 538
datadev Avatar asked Jul 04 '15 09:07

datadev


1 Answers

On SQL Database Premium Tiers requires the VIEW DATABASE STATE permission in the database. Permissions can not be granted in Master, but the views can be queried in user databases. On SQL Database Standard and Basic Tiers requires the SQL Database server admin account due to security requirements following from multi tenancy of those tiers.

like image 170
Jack Richins Avatar answered Sep 18 '22 07:09

Jack Richins