rwheeler23
asked on
SQL claims users do not exist when they do.
I wanted to grant access to a table to a user so I exeuted this:
GRANT SELECT,UPDATE,INSERT on [MyDB].[dbo].[MyTable] TO MyUser
Which returned this message:
Cannot find the user 'MyUser', because it does not exist or you do not have permission.
I then ran this:
EXEC sp_change_users_login @Action='update_one', @UserNamePattern='MyUser', @LoginName='MyUser';
Which returned this:
Terminating this procedure. The User name 'MyUser' is absent or invalid.
I am logged in as 'sa' and 'MyUser' is a valid SQL user.
I have checked other SQL users and they fail the same way.
What is wrong here and do I fix this?
GRANT SELECT,UPDATE,INSERT on [MyDB].[dbo].[MyTable] TO MyUser
Which returned this message:
Cannot find the user 'MyUser', because it does not exist or you do not have permission.
I then ran this:
EXEC sp_change_users_login @Action='update_one', @UserNamePattern='MyUser',
Which returned this:
Terminating this procedure. The User name 'MyUser' is absent or invalid.
I am logged in as 'sa' and 'MyUser' is a valid SQL user.
I have checked other SQL users and they fail the same way.
What is wrong here and do I fix this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If they were in the system it'd probably block adjustments to their user permissions, because of active use. So that makes sense.
ASKER
A more accurate message would have been helpful.
ASKER
Thanks
ASKER
I just tried the GRANT command again and it worked. The difference now is most users have gone home and the load on this old server is much lighter.