Check users in a security group in SQL Server(在 SQL Server 中检查安全组中的用户)
问题描述
在我的数据库的 Security/Users 文件夹中,我有一堆安全组,包括MyApplication Users".我需要检查我(或其他用户)是否在这个组中,但我不知道如何查询它或在哪里可以看到这些信息.我尝试查看属性,但找不到任何内容.有什么想法吗?
In the Security/Users folder in my database, I have a bunch of security groups, include "MyApplication Users". I need to check if I am (or another user is) in this group, but I have no idea how to query for it or where I could see this information. I tried looking in the properties, but couldn't find anything. Any ideas?
推荐答案
检查自己或当前用户:
SELECT IS_MEMBER('[group or role]')
结果 1 = 是,0 = 否,空 = 查询的组或角色无效.
A result of 1 = yes,0 = no, and null = the group or role queried is not valid.
要获取用户列表,请尝试 xp_logininfo,如果启用了扩展 procs 并且有问题的组是 Windows 组:
To get a list of the users, try xp_logininfo if extended procs are enabled and the group in question is a windows group :
EXEC master..xp_logininfo
@acctname = '[group]',
@option = 'members'
这篇关于在 SQL Server 中检查安全组中的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 SQL Server 中检查安全组中的用户


- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- SQL 临时表问题 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01