USP_DATALIST_SMARTQUERYOUTPUT

Displays the output columns for the given smart query.

Parameters

Parameter Parameter Type Mode Description
@SMARTQUERYID uniqueidentifier IN Input parameter indicating the context ID for the data list.

Definition

Copy


create procedure dbo.USP_DATALIST_SMARTQUERYOUTPUT
(
    @SMARTQUERYID uniqueidentifier
)
as
    set nocount on;

    with xmlnamespaces ('bb_appfx_smartquery' as tns, 'bb_appfx_commontypes' as common)
    select 
        smartqueryoutput.fields.value('@Name', 'nvarchar(max)') as NAME,
        smartqueryoutput.fields.value('@Caption', 'nvarchar(max)') as CAPTION,
        coalesce(smartqueryoutput.fields.value('@DataType', 'nvarchar(18)'), 'String') as DATATYPE,
        coalesce(smartqueryoutput.fields.value('@IsHidden', 'bit'), 0) as HIDDEN
    from dbo.SMARTQUERYCATALOG as Q
        cross apply Q.SMARTQUERYSPEC.nodes('tns:SmartQuerySpec/tns:Output/tns:OutputFields/tns:OutputField') as smartqueryoutput(fields)
    where Q.ID = @SMARTQUERYID