Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 2.33 KB

sp-helpntgroup-transact-sql.md

File metadata and controls

75 lines (54 loc) · 2.33 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_helpntgroup (Transact-SQL)
sp_helpntgroup reports information about Windows groups with accounts in the current database.
markingmyname
maghan
randolphwest
05/15/2024
sql
system-objects
reference
sp_helpntgroup
sp_helpntgroup_TSQL
sp_helpntgroup
TSQL

sp_helpntgroup (Transact-SQL)

[!INCLUDE SQL Server]

Reports information about Windows groups with accounts in the current database.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_helpntgroup [ [ @ntname = ] N'ntname' ]
[ ; ]

Arguments

[ @ntname = ] N'ntname'

The name of the Windows group. @ntname is sysname, with a default of NULL. @ntname must be a valid Windows group with access to the current database. If @ntname isn't specified, all Windows groups with access to the current database are included in the output.

Return code values

0 (success) or 1 (failure).

Result set

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.

Remarks

To see a list of the [!INCLUDE ssNoVersion] roles in the current database, use sp_helprole.

Permissions

Requires membership in the public role.

Examples

The following example prints a list of the Windows groups with access to the current database.

EXEC sp_helpntgroup;

Related content