IS_MEMBER_UDF

Description

Indicates whether the current user is a member of the specified Microsoft Windows group or SQL Server database role. The return type is an int value and a boolean in the UDF equivalence.

SQLServer syntax

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

Custom UDF overloads

Parameters

  1. ROLE: A string expression that represents the role to be evaluated.

CREATE OR REPLACE FUNCTION IS_MEMBER_UDF(ROLE STRING) RETURNS BOOLEAN as

$$

SELECT ARRAY_CONTAINS(UPPER(ROLE)::VARIANT, PARSE_JSON(CURRENT_AVAILABLE_ROLES()))

$$;

SQL Server

SELECT IS_MEMBER('abcdef');

Snowflake

SELECT
--** MSC-WARNING - MSCEWI1020 - CUSTOM UDF 'IS_MEMBER_UDF' INSERTED. **
IS_MEMBER_UDF('abcdef');
  1. MSCEWI1020: CUSTOM UDF INSERTED.

Last updated