{"id":225,"date":"2012-05-29T08:54:40","date_gmt":"2012-05-29T08:54:40","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2012\/05\/29\/msg-297-level-16-state-1-line-1-the-user-does-not-have-permission-to-perform-this-action\/"},"modified":"2012-05-29T08:54:40","modified_gmt":"2012-05-29T08:54:40","slug":"msg-297-level-16-state-1-line-1-the-user-does-not-have-permission-to-perform-this-action","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2012\/05\/29\/msg-297-level-16-state-1-line-1-the-user-does-not-have-permission-to-perform-this-action\/","title":{"rendered":"Msg 297, Level 16, State 1, Line 1 The user does not have permission to perform this action."},"content":{"rendered":"

Error Message:<\/strong>
\n
\nMsg 297, Level 16, State 1, Line 1
\nThe user does not have permission to perform this action.
\n<\/font><\/p>\n

Reason:<\/strong>
\nThis error occurs when the user does not have permission to execute a specific query.<\/p>\n

Example:<\/strong>
\nRevoke view state permission to user
\n[sql]
\nREVOKE VIEW SERVER STATE TO user_name
\n[\/sql]
\nYou will get the error message 297 when you execute this query to fetch the index usage stats
\n[sql]
\nselect * from sys.dm_db_index_usage_stats
\n[\/sql]<\/p>\n

Fix\/Resolution:<\/strong>
\nProvide the required permissions to the user.
\n[sql]
\nGRANT VIEW SERVER STATE TO user_name
\n[\/sql]
\nNote: replace user_name with the name of the user.<\/p>\n","protected":false},"excerpt":{"rendered":"

Error Message: Msg 297, Level 16, State 1, Line 1 The user does not have permission to perform this action. Reason: This error occurs when the user does not have permission to execute a specific query. Example: Revoke view state permission to user [sql] REVOKE VIEW SERVER STATE TO user_name [\/sql] You will get the…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2029],"tags":[2030,2031,2032,2033,2034],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/225"}],"collection":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":0,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}