UFN_PROMOTIONALCODE_CODEEXISTS

Checks the PROMOTIONALCODE table for the given code

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@CODETOTEST nvarchar(50) IN

Definition

Copy


create function dbo.UFN_PROMOTIONALCODE_CODEEXISTS
(
    @CODETOTEST nvarchar(50)
)
returns bit
with execute as caller
as begin
    if exists (select 1 from dbo.PROMOTIONALCODE where PROMOTIONALCODE = @CODETOTEST)
        return 1
    else
        return 0

    return 0
end