{"id":222,"date":"2012-05-29T06:28:30","date_gmt":"2012-05-29T06:28:30","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2012\/05\/29\/msg-4621-level-16-state-10-line-1-permissions-at-the-server-scope-can-only-be-granted-when-the-current-database-is-master\/"},"modified":"2012-05-29T06:28:30","modified_gmt":"2012-05-29T06:28:30","slug":"msg-4621-level-16-state-10-line-1-permissions-at-the-server-scope-can-only-be-granted-when-the-current-database-is-master","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2012\/05\/29\/msg-4621-level-16-state-10-line-1-permissions-at-the-server-scope-can-only-be-granted-when-the-current-database-is-master\/","title":{"rendered":"Msg 4621 Level 16 State 10 Line 1 Permissions at the server scope can only be granted when the current database is master"},"content":{"rendered":"
Error Message:<\/strong> This message occurs when the Server scope permissions are tried to be modified from any other database other than master.<\/p>\n Example:<\/strong> [sql] Fix\/Resolution:<\/strong> Error Message: Msg 4621, Level 16, State 10, Line 1 Permissions at the server scope can only be granted when the current database is master This message occurs when the Server scope permissions are tried to be modified from any other database other than master. Example: [sql] USE AdventureWorksDW2008R2 GRANT VIEW SERVER STATE TO USER1…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2019],"tags":[2020,2021,2022,2023],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-msg-4621","tag-how-to-fix-msg-4621-level-16-state-10-line-1-permissions-at-the-server-scope-can-only-be-granted-when-the-current-database-is-master","tag-msg-4621-level-16-state-10-line-1","tag-permissions-at-the-server-scope-can-only-be-granted-when-the-current-database-is-master","tag-sql-server-msg-4621-level-16-state-10-line-1-permissions-at-the-server-scope-can-only-be-granted-when-the-current-database-is-master"],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"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=222"}],"version-history":[{"count":0,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n
\nMsg 4621, Level 16, State 10, Line 1
\nPermissions at the server scope can only be granted when the current database is master
\n<\/font><\/p>\n
\n[sql]
\nUSE AdventureWorksDW2008R2
\nGRANT VIEW SERVER STATE TO USER1
\n[\/sql]<\/p>\n
\nUSE AdventureWorksDW2008R2
\nREVOKE VIEW SERVER STATE TO USER2
\n[\/sql]<\/p>\n
\nChange the database to master.
\n[sql]
\nUSE MASTER
\nGRANT VIEW SERVER STATE TO ABC
\n[\/sql]<\/p>\n","protected":false},"excerpt":{"rendered":"