I am trying to add a new user to an SQL Server 2012 database using SQL Server Management Studio. I right-click and select 'Add User' under Security -> Users, fill out the user information, and click OK. Management Studio throws the the error message "is not a valid login or you do not have permission”.

How can I add this user?

  • 1
    This question has the same error message as this other question, but happens during normal administration rather than during installation. It looks like there are different causes and answers, so I'm posting this as a separate question. – culix Sep 18 '14 at 13:06

Before adding a User you must first create a global Login, under Security -> Logins. Once the login exists you can add them as a User under a particular database.

  • what is the meaning of "a global Login" ? – WhyWhat Oct 8 '19 at 10:18
  • I guess we'll never know... – Denny Dec 17 '20 at 13:04

If you are trying to create a user under the Contained database user model (so no global login for it), you have to provide a password during creation like this:

CREATE USER user_name WITH PASSWORD = 'strong_password';

This worked for me :

CREATE USER [chris23] FROM LOGIN [##MS_PolicyEventProcessingLogin##];
EXEC sp_addrolemember N'db_datareader', 'chris23';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.