UFN_ADHOCQUERYFOLDER_ISDISPLAYORDERINUSE
Checks if a display order value is used by an ad-hoc query folder for a specific folder.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PARENTFOLDERID | uniqueidentifier | IN | |
@DISPLAYORDER | int | IN |
Definition
Copy
create function dbo.UFN_ADHOCQUERYFOLDER_ISDISPLAYORDERINUSE
(
@PARENTFOLDERID uniqueidentifier,
@DISPLAYORDER int
)
returns bit
with execute as caller
as
begin
declare @RETURNVALUE bit
set @RETURNVALUE = 1
if exists (
select 1 from dbo.ADHOCQUERYFOLDER
where
(PARENTFOLDERID = @PARENTFOLDERID or (PARENTFOLDERID is null and @PARENTFOLDERID is null)) and
DISPLAYORDER = @DISPLAYORDER
)
set @RETURNVALUE = 0
return @RETURNVALUE
end