UFN_EVENTLODGINGLOCATION_ISUNIQUE
Verifies only one lodging location per event.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@EVENTID | uniqueidentifier | IN | |
@EVENTLODGINGLOCATIONID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_EVENTLODGINGLOCATION_ISUNIQUE(
@EVENTID uniqueidentifier,
@EVENTLODGINGLOCATIONID uniqueidentifier
)
returns bit
with execute as caller
as begin
declare @DUPLICATECOUNT int;
select
@DUPLICATECOUNT = count(ID)
from
dbo.EVENTLODGING
where
EVENTID = @EVENTID and
EVENTLODGINGLOCATIONID = @EVENTLODGINGLOCATIONID
if @DUPLICATECOUNT < = 1
return 1;
return 0;
end