Cannot find the user '', because it does not exist or you do not have permission

113,867

Solution 1

I just encountered the same problem.

Make sure there is an user mapping for your login in the master table. No database role memberships are required, just tick 'Map' for the database master under 'User Mapping' in the properties for the login 'UserName'.

Solution 2

Run this:

USE [db_where_you_need_access]
GO
CREATE USER [your_user] FOR LOGIN [your_user]

Solution 3

I had this issue and yet I am in the local admin group on the server. Apparently if UAC is turned onrunning SQL Server Management Studio as administrator makes a world of difference. I didn't have any permissions until I did this.

Share:
113,867
Mathematics
Author by

Mathematics

Updated on March 24, 2020

Comments

  • Mathematics
    Mathematics about 4 years

    I am trying to add permissions to a Store procedure for a user using this query,

    USE [MyDatabaseName]
    GO
    
    GRANT EXEC ON [dbo].[StoreProcedureName] TO [UserName]
    GO
    

    I can give permissions to user through theUser Interface but using this query I get this error,

    Cannot find the user 'UserName', because it does not exist or you do not have permission.

    If I don't have permissions then how can I add permissions using User Interface.