CREATE FUNCTION [dbo].[LAFclassifier] ()
RETURNS SYSNAME WITH SCHEMABINDING
AS
BEGIN
DECLARE @GroupName SYSNAME;
SET @GroupName = 'default';
IF IS_MEMBER ( 'ACCOUNTING\SQLAdministrators' ) = 1
SET @GroupName = 'GroupMax';
ELSE IF SUSER_SNAME() = 'TestFull'
SET @GroupName = 'GroupMax';
ELSE IF SUSER_SNAME() = 'Test1Half'
SET @GroupName = 'Group1Half';
ELSE IF SUSER_SNAME() = 'Test2Half'
SET @GroupName = 'Group2Half';
RETURN @GroupName;
END;
GO