Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 3.44 KB

File metadata and controls

82 lines (65 loc) · 3.44 KB
title sp_helprole (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
sp_helprole_TSQL
sp_helprole
dev_langs
TSQL
helpviewer_keywords
sp_helprole
ms.assetid b023103f-ccf3-44e2-b418-4be9bdd49f4a
caps.latest.revision 27
author BYHAM
ms.author rickbyh
manager jhubbard

sp_helprole (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-asdb-xxxx-xxx_md]

Returns information about the roles in the current database.

Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssKatmai] through current version), [!INCLUDEssSDSfull].

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_helprole [ [ @rolename = ] 'role' ]  

Arguments

[ @rolename = ] 'role'
Is the name of a role in the current database. role is sysname, with a default of NULL. role must exist in the current database. If role is not specified, information about all roles in the current database is returned.

Return Code Values

0 (success) or 1 (failure)

Result Sets

Column name Data type Description
RoleName sysname Name of the role in the current database.
RoleId smallint ID of RoleName.
IsAppRole int 0 = RoleName is not an application role.

1 = RoleName is an application role.

Remarks

To view the permissions associated with the role, use sp_helprotect. To view the members of a database role, use sp_helprolemember.

Permissions

Requires membership in the public role.

Examples

The following query returns all the roles in the current database.

EXEC sp_helprole  

See Also

Security Stored Procedures (Transact-SQL)
Server-Level Roles
Database-Level Roles
sp_addapprole (Transact-SQL)
sp_addrole (Transact-SQL)
sp_droprole (Transact-SQL)
sp_helprolemember (Transact-SQL)
sp_helpsrvrolemember (Transact-SQL)
System Stored Procedures (Transact-SQL)