USP_MKTSEGMENTATIONEXPORTPROCESSSTATUSOUTPUTEMAILJOB_LOAD

Loads information necessary to create a NetCommunity email job from a mailing export.

Parameters

Parameter Parameter Type Mode Description
@BUSINESSPROCESSOUTPUTID uniqueidentifier IN

Definition

Copy


create procedure dbo.[USP_MKTSEGMENTATIONEXPORTPROCESSSTATUSOUTPUTEMAILJOB_LOAD]
(
  @BUSINESSPROCESSOUTPUTID uniqueidentifier
)
as
  set nocount on;

  declare @TABLENAME nvarchar(255);
  declare @SQL nvarchar(max);
  declare @PACKAGES xml;

  select @TABLENAME = [TABLENAME] from dbo.[BUSINESSPROCESSOUTPUT] where [ID] = @BUSINESSPROCESSOUTPUTID;

  set @SQL = 
    'select ' + char(13) +
    '  [ID] as [PACKAGEID],' + char(13) +
    '  [NAME] as [PACKAGENAME],' + char(13) +
    '  [NETCOMMUNITYDATASOURCEID],' + char(13) +
    '  [NETCOMMUNITYTEMPLATEID]' + char(13) +
    'from' + char(13) +
    '  dbo.[MKTPACKAGE]' + char(13) +
    'where' + char(13) +
    '  [ID] in (select distinct [PACKAGEID] from dbo.[' + @TABLENAME + '])';

  exec sp_executesql @SQL;

  -- use this to get the SPWrap Code Generator to update the wrapper code:

  -- 1. make the SPWRAP table's shape match that of the SQL above

  -- 2. uncomment the two lines below and load the spec

  -- 3. run the SPWrap Code Generator

  -- 4. comment the two lines below out again and load the spec

  -- make sure these lines are commented out before generating a revision for this spec!

  --declare @SPWRAP table([PACKAGEID] uniqueidentifier, [PACKAGENAME] nvarchar(100), [NETCOMMUNITYDATASOURCEID] integer, [NETCOMMUNITYTEMPLATEID] integer);

  --select * from @SPWRAP;


  return 0;