select s.ownerId, s.fsl_tablecode, s.skuId from tbl_PRD_SKus s with (nolock) where s.fsl_tablecode = 'CHO' and s.ownerId in ( select cho_id from tbl_CHO_Operators with (nolock) where cho_1fsSchoolsMember = 'Y' -- cho_segmentId = 56 ) and s.mfrSKUIdDate is null and s.mfrId > 0 order by s.ownerId, s.mfrId select distinct s.ownerId coopOwnerId, s.mfrId, s.mfrSkuId, cho.cho_name, mfr.mfr_name, ms.sku, ms.skuDesc from tbl_PRD_Skus s with (nolock) inner join tbl_PRD_Skus ms with (nolock) on ms.skuId= s.mfrSkuId and ms.ownerId = s.mfrId and ms.fsl_tablecode = 'MFR' inner join tbl_CHO_Operators cho with (nolock) on cho.cho_id = s.ownerId and cho.cho_1fsSchoolsMember = 'Y' inner join tblManufacturers mfr with (nolock) on mfr.mfr_id = s.mfrId where s.ownerId in ( select cho_id from tbl_CHO_Operators with (nolock) where cho_segmentId = 56 ) and s.fsl_tablecode = 'CHO' and s.mfrSkuIdDate is not null and s.mfrId > 0 and s.ownerId > 0 order by mfrId, coopOwnerId select ownerId, ownerType, syndicationSetId, syndicationSetName, linkId, linkType from tbl_PRD_SyndicationSets with (nolock) where ownerId = and ownerType = 'MFR' and syndicationSetName like '%(%CHO%:%)%' and linkId is null update tbl_PRD_SyndicationSets set linkId = , linkType = 'CHO' where ownerId = and ownerType = 'MFR' and syndicationSetId = select operatorId from tbl_OPR_ClientOperators with (nolock) where ownerId = and fsltablecode = 'MFR' and fsl_choId =
Importing #htmleditformat( cho_name )# (#_coopOwnerId#) into #htmleditformat( mfr_name )# (#_mfrId#)
select syndicationSetId, syndicationSetName from tbl_PRD_SyndicationSets with (nolock) where ownerId = and ownerType = 'MFR' and linkId = and linkType = 'CHO'
Creating Syndication Set '#htmleditformat( cho_name )#' for #htmleditformat( mfr_name )#
insert into tbl_PRD_SyndicationSets ( ownerId, ownerType, syndicationSetName, linkId, linkType, systemSet ) values ( , 'MFR', , , 'CHO', 'N' ) select syndicationSetId, syndicationSetName from tbl_PRD_SyndicationSets with (nolock) where ownerId = and ownerType = 'MFR' and linkId = and linkType = 'CHO'
select subscriptionId from tbl_PRD_Subscriptions with (nolock) where ownerId = and ownerType = 'MFR' and syndicationSetId = and subscriberType = 'CHO' and subscriberId =
Creating subscription to #htmleditformat( _syndicationSetName )# for #htmleditformat( mfr_name )#
insert into tbl_PRD_Subscriptions ( ownerType, ownerId, syndicationSetId, subscriberId, subscriberType ) values ( 'MFR', , , , 'CHO' )
select linkId from tbl_PRD_SyndicationSetContents with (nolock) where ownerId = and ownerType = 'MFR' and syndicationSetId = and contentRule = 'INCLUDE' and linkType = 'SKU'
Adding #htmleditformat( mfr_name )# #htmleditformat( sku )# - #htmleditformat( skuDesc )# to #htmleditformat( _syndicationSetName )#
insert into tbl_PRD_syndicationSetContents ( ownerId, ownerType, syndicationSetId, contentRule, linkId, linkType ) values ( , 'MFR', , 'INCLUDE', , 'SKU' )
Removing #_skuId# from #htmleditformat( _syndicationSetName )#
delete from tbl_PRD_SyndicationSetContents where ownerId = and ownerType = 'MFR' and contentRule = 'INCLUDE' and linkType = 'SKU' and linkId = and syndicationSetId =
select dataProviderId from tbl_PRD_DataProviders with (nolock) where ownerId = and ownerType = 'CHO' and dataOwnerId = and dataOwnerType = 'MFR'
Adding Data Provider to #htmleditformat( cho_name )# for #htmleditformat( mfr_name )#
insert into tbl_PRD_DataProviders ( ownerId, ownerType, dataOwnerId, dataOwnerType ) values ( , 'CHO', , 'MFR' )