USP_SIMPLEDATALIST_MKTMEMBERSHIPQUERYVIEW

Returns a list of all available membership query views.

Parameters

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

Definition

Copy


CREATE procedure dbo.[USP_SIMPLEDATALIST_MKTMEMBERSHIPQUERYVIEW]
(
  @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/@MarketingMembershipRecordSource)[1]'
    'char(1)') = '1'
  order by
    [DISPLAYNAME];