本文介绍了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 中用户和登录的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-19 07:00