UFN_VALIDJOURNALENTRYANNOTATIONCOUNT
Returns 1 if the number of annotations of the specified category and type is valid
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @JOURNALENTRYID | uniqueidentifier | IN | |
| @REFERENCENAME | varchar(255) | IN | |
| @ANNOTATIONCATEGORYCODE | tinyint | IN |
Definition
Copy
CREATE function dbo.UFN_VALIDJOURNALENTRYANNOTATIONCOUNT
(
@JOURNALENTRYID uniqueidentifier,
@REFERENCENAME varchar(255),
@ANNOTATIONCATEGORYCODE tinyint
)
returns bit
with execute as caller
as begin
declare @ret bit;
declare @cnt integer;
set @cnt=0;
set @ret=1;
if (@ANNOTATIONCATEGORYCODE>0) SELECT @cnt=COUNT(*) FROM dbo.JOURNALENTRYANNOTATION WHERE JOURNALENTRYID=@JOURNALENTRYID AND REFERENCENAME=@REFERENCENAME AND ANNOTATIONCATEGORYCODE=@ANNOTATIONCATEGORYCODE;
if (@cnt>1) set @ret=0;
return @ret
end