且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

sql server身份验证和windows身份验证有什么区别..?

更新时间:2021-09-11 19:59:27

SQL Server 有自己的内置安全系统,涵盖登录名和角色.这与 Windows 用户和组分开并平行.您可以只使用 SQL 安全性,然后所有管理都将在 SQL 服务器中进行,并且这些登录名和 Windows 用户之间没有任何联系.如果您使用混合模式,则 Windows 用户将被视为 SQL 登录.

SQL Server has its own built in system for security that covers logins and roles. This is separate and parallel to Windows users and groups. You can use just SQL security and then all administration will occur within SQL server and there's no connection between those logins and the Windows users. If you use mixed mode then Windows users are treated just like SQL logins.

每种方法都有许多特点 -

There are a number of features of each approach -

1) 如果您想使用连接池,您必须使用 SQL 登录名,或者都共享同一个 Windows 用户 - 不是一个好主意.

1) If you want to use connection pooling you have to use SQL logins, or all share the same windows user - not a good idea.

2) 如果您想跟踪特定用户的行为,那么使用 Windows 身份验证是有意义的.

2) If you want to track what a particular user is doing, then using the windows authentication makes sense.

3) 使用 Windows 工具管理用户比 SQL 强大得多,但两者之间的联系很脆弱,例如如果您删除一个 Windows 用户,则 SQL 中的相关数据不会更新.

3) Using the windows tools to administer users is much more powerful than SQL, but the link between the two is tenuous, for instance if you remove a windows user then the related data within SQL isn't updated.