This documentation is archived and is not being maintained.


Indicates whether a SQL Server 2005 login is a member of the specified fixed server role.

Topic link icon Transact-SQL Syntax Conventions

IS_SRVROLEMEMBER ('role' [ , 'login' ] )

' role '

Is the name of the server role that is being checked. role is sysname.

Valid values for role include the following:


  • dbcreator
  • bulkadmin
  • diskadmin
  • processadmin
  • serveradmin
  • setupadmin
  • securityadmin
' login '

Is the name of the SQL Server 2005 login to check. login is sysname, with a default of NULL. If no value is specified, the SQL Server login of the current user is used.

IS_SRVROLEMEMBER returns the following values.

Return value Description


login is not a member of role.


login is a member of role.


role or login is not valid.

Use this function to determine whether the current user can perform an action requiring the server role's permissions.

If a Microsoft Windows login, such as London\JoeB, is specified for login, IS_SRVROLEMEMBER returns NULL, unless the login has been granted or denied direct access to SQL Server 2005.

If login is a Windows domain login, it may be a member of a fixed server role through membership in a Windows group. To resolve such indirect memberships, IS_SRVROLEMEMBER requests Windows group membership information from the domain controller. If the domain controller is not accessible or does not respond, IS_SRVROLEMEMBER returns role membership information taking into account the user and its local groups only.

The following example indicates whether the SQL Server login for the current user is a member of the sysadmin fixed server role.

IF IS_SRVROLEMEMBER ('sysadmin') = 1
   print 'Current user''s login is a member of the sysadmin role'
   print 'Current user''s login is NOT a member of the sysadmin role'
   print 'ERROR: The server role specified is not valid.'