| description | sp_helpntgroup (Transact-SQL) | ||
|---|---|---|---|
| title | sp_helpntgroup (Transact-SQL) | Microsoft Docs | ||
| ms.custom | |||
| ms.date | 06/10/2016 | ||
| ms.prod | sql | ||
| ms.prod_service | database-engine | ||
| ms.reviewer | |||
| ms.technology | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | 02b4f7c1-480a-436c-8bae-7a2488be45d2 | ||
| author | markingmyname | ||
| ms.author | maghan |
[!INCLUDE SQL Server]
Reports information about Windows groups with accounts in the current database.
Transact-SQL Syntax Conventions
sp_helpntgroup [ [ @ntname= ] 'name' ]
[ @ntname = ] 'name'
Is the name of the Windows group. name is sysname, with a default of NULL. name must be a valid Windows group with access to the current database. If name is not specified, all Windows groups with access to the current database are included in the output.
0 (success) or 1 (failure)
| Column name | Data type | Description |
|---|---|---|
| NTGroupName | sysname | Name of the Windows group. |
| NTGroupId | smallint | Group identifier (ID). |
| SID | varbinary(85) | Security identifier (SID) of NTGroupName. |
| HasDbAccess | int | 1 = Windows group has permission to access the database. |
To see a list of the [!INCLUDEssNoVersion] roles in the current database, use sp_helprole.
Requires membership in the public role.
The following example prints a list of the Windows groups with access to the current database.
EXEC sp_helpntgroup;
Security Stored Procedures (Transact-SQL)
sp_grantdbaccess (Transact-SQL)
sp_helprole (Transact-SQL)
sp_revokedbaccess (Transact-SQL)
System Stored Procedures (Transact-SQL)