UFN_SEARCHLIST_PAGEREFERENCES

Returns a table of page IDs that reference the given search list.

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@SEARCHLISTID uniqueidentifier IN

Definition

Copy


CREATE function dbo.UFN_SEARCHLIST_PAGEREFERENCES
(
    @SEARCHLISTID uniqueidentifier
)
returns @TABLE table
(
    PAGEID uniqueidentifier
)
with execute as caller
as
begin

    -- find page/section actions that use this search list

    with xmlnamespaces ('bb_appfx_commontypes' as common)
    insert into @TABLE
        select distinct P.ID
        from dbo.PAGEDEFINITIONCATALOG as P
            cross apply P.PAGEDEFINITIONSPEC.nodes('//common:SearchListReturnValue') as action(searchcontexts)
        where action.searchcontexts.value('@SearchListID', 'uniqueidentifier') = @SEARCHLISTID;

    return;

end;