Difference between a User and a Login in SQL Server(SQL Server 中用户和登录的区别)
问题描述
我最近遇到了 SQL Server 的许多不同领域,而这些领域我通常不会搞砸.其中一个让我感到困惑的是登录和用户领域.看来这应该是一个很简单的话题……
I have recently been running into many different areas of SQL Server that I normally don't mess with. One of them that has me confused is the area of Logins and Users. Seems like it should be a pretty simple topic...
似乎每个登录名只能有1个用户,每个用户只能有1个登录名.
It appears that each login can only have 1 user and each user can only have 1 login.
一个登录名可以关联到多个表,从而将该用户关联到多个表.
A login can be associated to multiple tables thus associating that user to many tables.
所以我的问题是为什么还要有登录名和用户?他们似乎几乎是一回事.有什么区别,或者我似乎缺少什么?
So my question is why even have a login and a user? they seem to be pretty much one in the same. What are the differences, or what is it that I seem to be missing?
推荐答案
登录"授予主体进入 SERVER.
A "Login" grants the principal entry into the SERVER.
用户"将登录条目授予单个数据库.
A "User" grants a login entry into a single DATABASE.
一个登录"可以与多个用户关联(每个数据库一个).
One "Login" can be associated with many users (one per database).
上述每个对象都可以在其自己的级别上授予权限.有关每个的解释,请参阅以下文章
Each of the above objects can have permissions granted to it at its own level. See the following articles for an explanation of each
- 主体
- 数据库用户
这篇关于SQL Server 中用户和登录的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQL Server 中用户和登录的区别
基础教程推荐
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 无法解决整理冲突 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
