Sql-server – How to set up SQL Server 2008 users without Windows/Domain accounts

sql serversql-server-2008

I'm trying to do this through the SQL Server Management Studio GUI.

The user accounts will be accessed by applications directly, so I don't want to create Windows user accounts. I'd rather use something like the sa account.

Is there a way of creating users directly in SQL Server?

Best Answer

The first part is to create a login for the new user, if you can't login to the server you can't perform queries on a database.

In MSSMS Expand the Security tab, right click on Login and select New User. Click the SQL Server authentication radio button and fill in the password for the new user. You will probably want to uncheck the box for "Enforce password expiration" and "User must change password at next login" if you are using the login from an application.

Click the User Mapping page in the left panel and map the new login to a database and give them the desired roles, click OK and you're done.

With all of that said there are two things you should be aware of.

  1. Questions like this are better asked on https://serverfault.com/ or apparently http://dba.stackexchange.com :-)
  2. It is still better to create windows / domain accounts and either run your application pool under that context or use impersonation.