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?
Best Answer
Before adding a user one must first create a login. Logins can only be created in the servers
Security
-folder (not in the databsesSecurity
).So the login can be created under
<server>/Security -> Right-Click -> New -> Login...
.A user with the same name and settings will automatically be added to the databases selected in the
User Mapping
tab when creating the login.<server>/<database>/Security -> Right-Click -> New -> User
. Note that the names of the users and logins must match.<server>/<database>/Security/Users/<user> -> Right-Click -> Properties
.