UFN_CONSTITUENT_ISSCHOOL

Validates whether the constituent record is a school.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@CONSTITUENTID uniqueidentifier IN

Definition

Copy


            create function dbo.UFN_CONSTITUENT_ISSCHOOL
            (
                @CONSTITUENTID uniqueidentifier
            )
            returns bit
            with execute as caller
            as begin
                    /* A constituent is a school if they have a record in the school table */
                if exists(
                    select
                        ID
                    from
                        dbo.SCHOOL
                    where
                        SCHOOL.ID = @CONSTITUENTID
                ) return 1;

                return 0;
            end