XLeratorDB/util Online Documentation
DatabaseRoleExists
Updated: 30 October 2008
Use wct.DatabaseRoleExists to determine if the specified database role exists in the database.
Syntax
SELECT [westclintech].[wct].[DatabaseRoleExists](
<@RoleName, nvarchar(4000),>)
Arguments
@RoleName
is the name of database role being tested for on the database. @RoleName is an expression of the character string data type category.
Return Types
bit
Remarks
· DatabaseRoleExists simplifies SQL intended to drop an application role if it exists.
Example
IF (wct.DatabaseRoleExists('myDBRole') <> 0) DROP ROLE myDBRole
Here is the result set
----------------------
Command(s) completed successfully