UFN_BATCHINTERACTION_LOOKUPIDISUNIQUE
Validates whether the batch interaction lookup ID is unique.
Return
| Return Type |
|---|
| bit |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @BATCHID | uniqueidentifier | IN | |
| @BATCHINTERACTIONLOOKUPID | nvarchar(100) | IN |
Definition
Copy
create function dbo.UFN_BATCHINTERACTION_LOOKUPIDISUNIQUE
(
@BATCHID uniqueidentifier,
@BATCHINTERACTIONLOOKUPID nvarchar(100)
)
returns bit
with execute as caller
as begin
declare @DUPLICATECOUNT int;
select
@DUPLICATECOUNT = count(*)
from
dbo.BATCHINTERACTION
where
BATCHID = @BATCHID
and BATCHINTERACTIONLOOKUPID = @BATCHINTERACTIONLOOKUPID;
if (@DUPLICATECOUNT <= 1)
return 1;
return 0;
end