SQL Server - server login and database entry

Can someone give me a 30-foot overview of the differences and relationships of server login and database login?

+4
source share
4 answers

Login for authentication. The database user is intended for authorization.

In simple terms, logging on to a server allows you to connect to a SQL Server database server. This is an external shell for credential authentication.

The database user, on the other hand, does not have its own credentials and relies on the server login for authentication. The database user is used directly for authorization, allowing you to grant rights to database objects, such as procs, tables, views.

+8
source

The server has logins. This is either a connection to a Windows account, a combination of username and password, or a certificate, or an asymmetric key.

There are users in the database. Users in the database are usually mapped to logins, but this is not a requirement - they can also be mapped to certificates or keys.

Most permissions in SQL Server are assigned to roles or users in the database (exception: "Server roles" provide "specific logon permissions"). A user can be a member of several roles.

A single login can be mapped to another user in each database to which they have been granted access.

+7
source

Database-Login: you manage users with a password with an SQL server, data is stored in the database itself

Server-Login: you are using Windows users on the os server

+1
source

To connect to the server, you must enter the server. To use the database, login to the database is required. The server login will be assigned to the server role (for example, the backup operator), and the database login will be assigned to the roles in this database.

+1
source

Source: https://habr.com/ru/post/1343016/


All Articles