USP_SIMPLEDATALIST_MKTAPPEALQUERYVIEW

Returns a list of all available appeal query views.

Parameters

Parameter Parameter Type Mode Description
@ROOTONLY bit IN Only show root level query views?

Definition

Copy


CREATE procedure dbo.USP_SIMPLEDATALIST_MKTAPPEALQUERYVIEW
(
  @ROOTONLY bit = 0
)
as
  set nocount on;

  if @ROOTONLY is null
    set @ROOTONLY = 0;

  select
    [ID] as [VALUE],
    [DISPLAYNAME] as [LABEL]
  from
    dbo.[QUERYVIEWCATALOG]
  where
    (0 = @ROOTONLY or [ROOTOBJECT] = @ROOTONLY
  and
    QUERYVIEWSPEC.value (
    'declare namespace bbafx="bb_appfx_queryview";
    declare namespace c="bb_appfx_commontypes";
    (bbafx:QueryViewSpec/c:MetaTags/@MarketingAppealRecordSource)[1]','char(1)'
    )='1'
  order by
    [DISPLAYNAME];