SQL Server - Server Login vs. Database Login [closed]
We don’t allow questions seeking recommendations for books, tools, software librarie开发者_如何学运维s, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this questionCould someone give me a 30K foot overview of the differences and relationships of a server login vs. a database login?
A Server Login is for authentication. A Database User is for authorization.
In the very simplest terms, a server login allows you to connect to the SQL Server database server. It's an outer shell for authenticating credentials.
The database user, on the other hand, does not have proper credentials of its own and relies on the server login for authentication. The database user's is used directly for authorization, allowing rights to be granted to database objects such as procs, tables, views.
The server has logins. These are either an association with a windows account, a username and password combination, a certificate or asymmetric key.
The database has users. The users in a database are usually mapped to Logins, but this is not a requirement - they may be mapped to Certificates or Keys also.
Most permissions within SQL Server are assigned to roles or users within a database (exception: Server Roles "grant" certain permissions to a login). A user may be a member of multiple roles.
A single login may be mapped to a different user in each database to which they have been granted access.
Database-Login: you manage the users on password with SQL-Server, the data are stored in the database itself
Server-Login: you use the windows users of the server os
Server login is required to connect to the server. Database login is required to use the database. The Server login will be assigned to server roles (backup operator for example) and the database login will be assigned to roles within that database.
精彩评论