select distinct c.campaignName, c.businessOwnerRefNum from tbl_GTM_Campaigns c with(nolock) where c.ownerId = and c.ownerType = and c.businessOwnerRefNum > '' select r.customerId, r.CustomerName, r.campaignName, r.campaignCode from tbl_import_emailCampaignResources r with(nolock) where r.ownerId = and r.ownerType = and r.campaignCode NOT in () update r set fseCampaignId = c.campaignId from tbl_import_emailCampaignResources r with(nolock) inner join tbl_GTM_Campaigns c with(nolock) on c.ownerid = r.ownerId and c.ownerType = r.ownerType and c.businessOwnerRefNum = r.campaignCode where r.ownerId = and r.ownerType = update r set fsePartnerId = o.operatorId, fsePartnerType = 'OPR', fseFSPro_userId = r.contactId from tbl_import_emailCampaignResources r with(nolock) inner join tbl_OPR_ClientOperators o with(nolock) on o.operatorId = r.customerId and o.ownerid = r.ownerId and o.fsltablecode = r.ownerType where r.ownerId = and r.ownerType = update r set fsePartnerId = d.cdr_recordId, fsePartnerType = 'CDR', fseFSPro_userId = r.contactId from tbl_import_emailCampaignResources r with(nolock) inner join tbl_CDR_Distributors d with(nolock) on d.cdr_recordId = r.customerId and d.ownerid = r.ownerId and d.fsl_tablecode = r.ownerType where r.ownerId = and r.ownerType = select r.* from tbl_import_emailCampaignResources r with(nolock) where r.ownerId = and r.ownerType = and r.campaignCode in () update e set externalResourceLink_1 = ,externalResourceLink_2 = ,updateSourceType = 'EAI' ,updateSourceId = ,updateDate = from tbl_GTM_externalResources e with(nolock) where e.ownerId = and e.ownerType = and e.campaignId = and e.targetPartnerId = and e.targetContactId = insert into tbl_GTM_ExternalResources (ownerType, ownerId, campaignId ,targetPartnerType, targetPartnerId, targetPartnerDescription ,targetContactId, targetContactDescription ,externalResourceLink_1 ,externalResourceLink_2 ,createSourceType, createSourceId, createDate) values ('#qmd_batch.ownerType#', #qmd_batch.ownerId#, #fseCampaignId# ,'#fsePartnerType#', #fsePartnerId#, '#customerName#' ,#fseFspro_userId#, '#contactName#' ,'#videoUrlRedirect#', '#ctaeoUrlRedirect#' ,'EAI', #eai_batchId#, #now()#) select lineCount from tbl_EAI_inboundBatches where batchId =

#htmleditformat( qmd_batch.fileFormat )# Results

Imported #qmd_stats.lineCount# into #_fileFormat.stagingTable#

Invalid Campaign