UFN_EMAILTEMPLATE_NAME_IN_USE

Return

Return Type
bit

Parameters

Parameter Parameter Type Mode Description
@TEMPLATENAME varchar(60) IN
@TEMPLATEID int IN

Definition

Copy


create function dbo.UFN_EMAILTEMPLATE_NAME_IN_USE
(
  @TEMPLATENAME varchar(60),
  @TEMPLATEID int
)
returns bit
with execute as caller
as begin
    declare @InUse bit

    set @InUse = 0
    if EXISTS (
            select top 1 t.DisplayName
            from dbo.NC_Notification t
            where t.DisplayName = @TEMPLATENAME and t.ID <> @TEMPLATEID
            )
    begin
        SET @InUse = 1
    end

    return @InUse
end