UFN_REPORT_TASKREFERENCES

Returns a table of task IDs that reference the given report.

Return

Return Type
table

Parameters

Parameter Parameter Type Mode Description
@REPORTID uniqueidentifier IN

Definition

Copy


create function dbo.UFN_REPORT_TASKREFERENCES
(
    @REPORTID uniqueidentifier
)
returns @TABLE table
(
    TASKID uniqueidentifier
)
with execute as caller
as
begin

    -- find tasks with page actions that use this report

    with xmlnamespaces ('bb_appfx_task' as tns, 'bb_appfx_commontypes' as common)
    insert into @TABLE
        select T.ID
        from dbo.TASKCATALOG as T
        where T.TASKSPECXML.value('(tns:TaskSpec/common:ShowReport/@ReportID)[1]', 'uniqueidentifier') = @REPORTID;

    return;

end;