UFN_MKTSPONSORSHIPMAILINGTEMPLATERULE_BASECURRENCIESMATCH

Indicates whether or not the base currency of a sponsorship template rule matches that of its parent sponsorship template.

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@BASECURRENCYID uniqueidentifier IN
@SPONSORSHIPMAILINGTEMPLATEID uniqueidentifier IN

Definition

Copy


create function dbo.[UFN_MKTSPONSORSHIPMAILINGTEMPLATERULE_BASECURRENCIESMATCH]
(
  @BASECURRENCYID uniqueidentifier,
  @SPONSORSHIPMAILINGTEMPLATEID uniqueidentifier
)
returns bit
as
begin
  declare @MATCH bit;

  if @BASECURRENCYID is not null
    set @MATCH = (case when @BASECURRENCYID = (select [BASECURRENCYID] from dbo.[MKTSPONSORSHIPMAILINGTEMPLATE] where [ID] = @SPONSORSHIPMAILINGTEMPLATEID) then 1 else 0 end);
  else
    -- if @BASECURRENCYID is null, the trigger on the sponsorship template rule table is going to set it to match that of the template, so the point is moot

    set @MATCH = 1;

  return @MATCH;
end;