UFN_DISCOUNT_HASCONSTITUENCY_2

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN
@DISCOUNTID uniqueidentifier IN

Definition

Copy


      create function dbo.UFN_DISCOUNT_HASCONSTITUENCY_2(@ID uniqueidentifier, @DISCOUNTID uniqueidentifier)
      returns bit
            with execute as caller
            as begin

      if @DISCOUNTID is null
        return dbo.UFN_DISCOUNT_HASCONSTITUENCY(@ID)

            if exists ( select DISCOUNTCONSTITUENCY.ID
                from dbo.DISCOUNTCONSTITUENCY
                where DISCOUNTCONSTITUENCY.CONSTITUENCYSYSTEMNAMEID = @ID and DISCOUNTCONSTITUENCY.DISCOUNTID = @DISCOUNTID
             )
              return 1;

              return 0;

      end