Share via


sp_helpntgroup (Transact-SQL)

報告目前資料庫中 Windows 群組和帳戶的相關資訊。

主題連結圖示Transact-SQL 語法慣例

語法

sp_helpntgroup [ [ @ntname= ] 'name' ] 

引數

  • [ @ntname = ] 'name'
    這是 Windows 群組的名稱。namesysname,預設值是 NULL。name 必須是具有目前資料庫存取權的有效 Windows 群組。如果未指定 name,則輸出會包括所有具目前資料庫存取權的 Windows 群組。

傳回碼值

0 (成功) 或 1 (失敗)

結果集

資料行名稱 資料類型 描述

NTGroupName

sysname

Windows 群組的名稱。

NTGroupId

smallint

群組識別碼 (ID)。

SID

varbinary(85)

NTGroupName 的安全性識別碼 (SID)。

HasDbAccess

int

1 = Windows 群組具有資料庫的存取權限。

備註

若要查看目前資料庫中 SQL Server 角色的清單,請使用 sp_helprole

權限

需要 public 角色中的成員資格。

範例

下列範例會印出具有目前資料庫存取權的 Windows 群組清單。

EXEC sp_helpntgroup

請參閱

參考

安全性預存程序 (Transact-SQL)
sp_grantdbaccess (Transact-SQL)
sp_helprole (Transact-SQL)
sp_revokedbaccess (Transact-SQL)
系統預存程序 (Transact-SQL)

說明及資訊

取得 SQL Server 2005 協助