开发者

Guest User in SQL Server

开发者 https://www.devze.com 2023-01-04 21:41 出处:网络
When i Execute the Below Query it does开发者_运维百科n\'t show me whether the guest account is enabled or disabled.

When i Execute the Below Query it does开发者_运维百科n't show me whether the guest account is enabled or disabled.

SELECT name, type_desc, is_disabled 
  FROM sys.server_principals 


YOU CAN TRY SOMETHING LIKE THIS:

SELECT U.UID, U.STATUS, U.NAME, U.SID, P.TYPE, P.TYPE_DESC, P.IS_DISABLED, P.NAME, P.PRINCIPAL_ID FROM SYSUSERS U LEFT OUTER JOIN SYS.SERVER_PRINCIPALS P ON U.[name] = P.[name]


The guest user is actually per database so it would be listed in sys.database_principals (sys.server_principals is for server level security and logins).

The rights are contained in each databases sys.database_permissions. To connect to a database, you need CONNECT rights assigned:

CREATE USER foo FROM ...
GRANT CONNECT TO foo

So, what rows are there is sys.database_permissions for guest?

0

精彩评论

暂无评论...
验证码 换一张
取 消