UFN_APPUSER_ISSYSADMIN

This function returns a boolean indicating whether or not the specified user is a system administrator.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@APPUSERID uniqueidentifier IN

Definition

Copy


CREATE function dbo.UFN_APPUSER_ISSYSADMIN 
(
    @APPUSERID uniqueidentifier

  returns bit
as
begin
    declare @ISSYSADMIN as bit
    set @ISSYSADMIN = 0

    select 
        @ISSYSADMIN = ISSYSADMIN
    from 
        dbo.APPUSER (nolock)
    where
        APPUSER.ID = @APPUSERID;

    return @ISSYSADMIN
end