I have received comment from Radha Goswami on my previous blog article SQL SERVER – 2008 – Activity Monitor is Empty – Fix Activity Monitor for All Users. Radha is facing following error when she is tring to grant permission to login.
Error:
Msg 4621, Level 16, State 10, Line 1
Permissions at the server scope can only be granted when the current database is master
Following image is I have recreated based on the above error message.
Fix/Workaround/Solution:
If you look at the database in use is AdventureWorks and when any server level persmission has to be granted the database in context should be of master database. Change the database used to master and it should fix the error.
Reference : Pinal Dave (https://blog.sqlauthority.com)
6 Comments. Leave new
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Alanna
Hi I have updated windows xp. But my sql 2005 userid password not working. Can you please help me??
I’m using the following SQL commend but got the error saying “can not find the login”. I’m using the windows AD group login.
USE master;
GRANT VIEW ANY DEFINITION TO [PRCINS\SQL_READ_AgencyDataRepository_NJ_Model]
GO
Error:
Msg 15151, Level 16, State 1, Line 2
Cannot find the login ‘PRCINS\SQL_READ_AgencyDataRepository_NJ_Model’, because it does not exist or you do not have permission.
There is a workaround for this, if the user wants to script the solution:
Incomplete solutions doesn’t help at all. You have just said to change your current database to master but then haven’t even thought to mention how to do that.
Here is how you can change the context to master.
USE master;