sp_helprole (Transact-SQL)
Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance
Returns information about the roles in the current database.
Transact-SQL syntax conventions
Syntax
sp_helprole [ [ @rolename = ] N'rolename' ]
[ ; ]
Arguments
[ @rolename = ] N'rolename'
The name of a role in the current database. @rolename is sysname, with a default of NULL
. @rolename must exist in the current database. If @rolename isn't specified, information about all roles in the current database is returned.
Return code values
0
(success) or 1
(failure).
Result set
Column name | Data type | Description |
---|---|---|
RoleName |
sysname | Name of the role in the current database. |
RoleId |
smallint | ID of RoleName . |
IsAppRole |
int | 0 = RoleName isn't 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;
Related content
प्रतिक्रिया
https://aka.ms/ContentUserFeedback.
जल्द आ रहा है: 2024 के दौरान हम सामग्री के लिए फीडबैक तंत्र के रूप में GitHub मुद्दों को चरणबद्ध तरीके से समाप्त कर देंगे और इसे एक नई फीडबैक प्रणाली से बदल देंगे. अधिक जानकारी के लिए, देखें:के लिए प्रतिक्रिया सबमिट करें और देखें