3

I am trying to add a user to SQL Server 2012 Express by right clicking the users folder and clicking add.

I am selecting "SQL user with login" and filling out login info but it is giving me this error:

enter image description here

I am running Windows Web Server 2008 R2. I have tried different names in case it was conflicting and no joy. There is already a user in another database that someone else added previously. I tried to add a user to that database and got the same error so I am not sure what they did differently to me.

I tried running SQL Server Management Studio as administrator but when I do that the add user dialog changes and only lets me create windows user, no sql with login option is there.

I have also tried with a query:

CREATE LOGIN loginname
   WITH PASSWORD = 'pass'

It says it is completed successfully but no user is created.

Anyone know what I am doing wrong?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Guerrilla
  • 13,375
  • 31
  • 109
  • 210

2 Answers2

2

You need to create a login to the server, then a user in the database.

Create Login Create Database User

If you successfully created loginname, at the server level folder in SSMS, double click on the login and you will see options to grant the user permissions to the necessary database as well as assign a server level role. Once the login is configured and you have given permissions to the database, you can look in the User folder of the database and see the user.

Also answered in: How do I create a new user in SQL Server 2012 that I can use in a connection string?

Community
  • 1
  • 1
Vinnie
  • 3,889
  • 1
  • 26
  • 29
-1

Does your SQL user you're logging in with have priv to create a user? This is not the same as launching the application with an elevation (right clicking the shortcut, and clicking run as administrator).

qwolf0
  • 1
  • 4