sp_helpntgroup (Transact-SQL)


Updated: June 10, 2016

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

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon 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 nameData typeDescription
NTGroupNamesysnameName of the Windows group.
NTGroupIdsmallintGroup identifier (ID).
SIDvarbinary(85)Security identifier (SID) of NTGroupName.
HasDbAccessint1 = Windows group has permission to access the database.

To see a list of the SQL Server 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)

Community Additions