SQL Server Login and Database User

December 10, 2007

The terms login and user are often used interchangeably. However, they are used consistently to refer to two different things in Microsoft SQL Server context. In full, they are called SQL Server Login and Database User. Login is at server level whereas user is database level.

SQL Server Login

Login is meant for authentication. You provide a login to gain access to SQL Server. Having accessed the SQL Server does not mean having access to the databases. Some logins are given access to perform server level activities and has no access to database. Other users could be granted access to some of the databases hosted but not necessarily all.

In the Object Explorer of Microsoft SQL Server Management Studio, you will find login under Security > Logins. The following figure shows where login is located.

SQL Server Object Explorer Login Node

Database User

User on the other hand is used to provide access and determine permission on a database. This is database specific. The same login may have different set of permission for different database on the same server.

In the Object Explorer of Microsoft SQL Server Management Studio, you will find user under Database > [Database Name] > Security > Users. User is created by mapping a SQL Server login to a database. The following figure illustrates where user is found in Object Explorer.

SQL Server Object Explorer User Node

0 comment :