USP_SIMPLEDATALIST_DATALISTOUTPUTFIELDS

Parameters

Parameter Parameter Type Mode Description
@DATALISTID uniqueidentifier IN
@INCLUDEHIDDEN bit IN

Definition

Copy


create procedure dbo.USP_SIMPLEDATALIST_DATALISTOUTPUTFIELDS
(
    @DATALISTID uniqueidentifier,
    @INCLUDEHIDDEN bit = 0
)
as
    set nocount on;

    with xmlnamespaces ('bb_appfx_datalist' as tns, 'bb_appfx_commontypes' as common)
    select 
        datalistoutput.fields.value('@FieldID', 'nvarchar(max)') as VALUE               
    from dbo.DATALISTCATALOG as D
        cross apply D.DATALISTSPEC.nodes('tns:DataListSpec/tns:Output/tns:OutputFields/tns:OutputField') as datalistoutput(fields)
    where 
        (D.ID = @DATALISTID) and
        ((@INCLUDEHIDDEN = 1) or (coalesce(datalistoutput.fields.value('@IsHidden', 'bit'), 0) = 0))