UFN_EVENTDESIGNATION_ONEDEFAULT
UFN_EVENTDESIGNATION_ONEDEFAULT
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@EVENTID | uniqueidentifier | IN | |
@DEFAULT | bit | IN |
Definition
Copy
CREATE function dbo.UFN_EVENTDESIGNATION_ONEDEFAULT(
@EVENTID uniqueidentifier,
@DEFAULT bit
)
returns bit
with execute as caller
as begin
declare @DUPLICATECOUNT int;
select
@DUPLICATECOUNT = count(ID)
from
dbo.EVENTDESIGNATION
where
EVENTID = @EVENTID
and [DEFAULT] = 1
if @DUPLICATECOUNT <= 1
return 1;
return 0;
end