Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize
This topic has not yet been rated - Rate this topic

IS_MEMBER

SQL Server 2000

Indicates whether the current user is a member of the specified Microsoft® Windows NT® group or Microsoft SQL Server™ role.

Syntax

IS_MEMBER ( { 'group' | 'role' } )

Arguments

'group'

Is the name of the Windows NT group being checked; must be in the format Domain\Group. group is sysname.

'role'

Is the name of the SQL Server role being checked. role is sysname and can include the database fixed roles or user-defined roles but not server roles.

Return Types

int

Remarks

IS_MEMBER returns these values.

Return value Description
0 Current user is not a member of group or role.
1 Current user is a member of group or role.
NULL Either group or role is not valid.

This function can be useful to programmatically detect whether the current user can perform an activity that depends on the permissions applied to a group or role.

Examples

This example indicates whether the current user is a member of the db_owner fixed database role.

IF IS_MEMBER ('db_owner') = 1
   print 'Current user is a member of the db_owner role'
ELSE IF IS_MEMBER ('db_owner') = 0
   print 'Current user is NOT a member of the db_owner role'
ELSE IF IS_MEMBER ('db_owner') IS NULL
   print 'ERROR: Invalid group / role specified'

See Also

IS_SRVROLEMEMBER

Security Functions

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.