Creating database users and mapping them to logins

Logins ensure authentication and access to server resources. To access a database, they must map to a user inside the database. The user is the security principal for a database. Access to database objects is granted to a user, not to a login.

How to do it...

There are two ways to create a database user in the SSMS graphical tools, either in the login Properties page at the server level or inside a database in the Security/Users node. We will follow the second path here, which is as follows:

  1. In the SQL Server Management Studio Object Explorer, click on the Databases node of your instance, and enter the desired database name. Click on the Security node. Right-click on the Users node and choose New ...

Get Microsoft SQL Server 2012 Security Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.