update stage set stage.fse_mfrid = s.mfrId, stage.fse_skuID = s.skuId, stage.fse_importStatus = 'Mapped', stage.fse_importStatusComments = 'Mapped via loaded fseSkuId' from tbl_IMPORT_ProductDataEnrichment stage inner join tbl_PRD_Skus s on s.skuid = stage.fse_skuId where stage.eai_batchId = and nullif(stage.fse_skuid,'') is not null and s.fsl_TableCode = and s.ownerId = select stage.fse_skuRequestId, stage.eai_importid from tbl_IMPORT_ProductDataEnrichment stage where stage.eai_batchId = and nullif(stage.fse_skuRequestId,'') is not null and nullif(stage.fse_importStatus,'') is null select top 1 sr.skuRequestId, s.skuid, s.mfrid, sr.requestorType, sr.requestorId from tbl_PRD_SKus s inner join tbl_PRD_SkuRequestLink srl on s.skuid = srl.skuid inner join tbl_PRD_SkuRequest sr on srl.skuRequestId = sr.skuRequestId where s.fsl_TableCode = and s.ownerid = and sr.skuRequestId = order by Rowid desc update stage set stage.fse_skuRequestId = , stage.fse_cdrRecordId = , stage.fse_requestorType = , stage.fse_mfrid = , stage.fse_skuID = , stage.fse_importStatus = 'Mapped', stage.fse_importStatusComments = 'Mapped via RequestId (#qry_getRequestLink.skuRequestId#)' from tbl_IMPORT_ProductDataEnrichment stage where stage.eai_batchId = and stage.eai_importid = update stage set stage.fse_mfrID = a.mfr_id from tbl_IMPORT_ProductDataEnrichment stage inner join tblManufacturers a on stage.manufacturerName = a.mfr_name inner join tblMfrBrokerLink mbl on a.mfr_id = mbl.mfr_id where stage.eai_batchid = and stage.manufacturerName IS NOT NULL and mbl.broker_id = and nullif(stage.fse_mfrid,'') is null update stage set stage.fse_mfrID = a.objectId from tbl_IMPORT_ProductDataEnrichment stage inner join tbl_IMPORT_Aliases a on stage.manufacturerName = a.alias where stage.eai_batchid = and a.ownerid = and a.ownerType = and a.objectType = 'MFRID' and stage.fse_mfrID is null and stage.manufacturerName IS NOT NULL and nullif(stage.fse_mfrid,'') is null select eai_lineNumber from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchid = and stage.fse_mfrID IS NULL and nullif(stage.fse_mfrid,'') is null select objectId, alias from tbl_IMPORT_Aliases with (nolock) where ownerid = and ownerType = and objectType = 'MFRID' update stage set stage.fse_mfrId = , stage.fse_importStatus = 'Mapped', stage.fse_importStatusComments = 'Mapped via MFR Alias(#qry_getAlias.alias#)' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.manufacturerName = and stage.fse_mfrId IS NULL and nullif(stage.fse_mfrid,'') is null select stage.fse_mfrid from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.ownerType = and stage.ownerid = and stage.fse_mfrId IS NULL and nullif(stage.fse_mfrid,'') is null update stage set stage.fse_importStatus = 'Unmapped MFR', stage.fse_importStatusComments = 'Unable to determine the Manufacturer.' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchid = and stage.ownerid = and stage.ownerType = and stage.fse_mfrID is null select * from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchid = and stage.ownerid = and stage.ownerType = and stage.fse_mfrID is null select ManufacturerName, mfrSKuCode as Sku, mfrSkuDesc as SkuDesc, fse_importStatus from tbl_IMPORT_ProductDataEnrichment stage with (nolock) left outer join tblManufacturers mfr with (nolock) on mfr.mfr_id = stage.fse_mfrid left outer join tbl_PRD_Skus s with (nolock) on s.skuid = stage.fse_skuid where stage.eai_batchId = order by mfr.mfr_name, mfrSku, Sku, fse_importStatus #_batchResults# select stg.eai_linenumber, stg.manufacturerName, stg.manufacturerPartNumber, stg.mfrSKuCode, stg.fse_mfrID, stg.fse_importStatus, stg.fse_skuid, stg.GTINItem, #attributes.datasource#.dbo.RemoveChars(stg.GTINItem,'32,39,40,41,45,47,92') as GTINItem_Clean, stg.GTINBox, #attributes.datasource#.dbo.RemoveChars(stg.GTINBox,'32,39,40,41,45,47,92') as GTINBox_Clean, stg.GTINCase, #attributes.datasource#.dbo.RemoveChars(stg.GTINCase,'32,39,40,41,45,47,92') as GTINCase_Clean, stg.GTINPallet, #attributes.datasource#.dbo.RemoveChars(stg.GTINPallet,'32,39,40,41,45,47,92') as GTINPallet_Clean, #attributes.datasource#.dbo.RemoveChars(stg.mfrSkuCode,'32,39,40,41,45,47,92') as sku_Clean, #attributes.datasource#.dbo.RemoveChars(stg.requestedManufacturerUPC,'32,39,40,41,45,47,92') as requestedUPC_Clean, #attributes.datasource#.dbo.RemoveChars(stg.mfrSkuCode,'32,39,40,41,45,47,92') as sku_Clean, stg.partNumberStatus, stg.fse_skuRequestId from tbl_IMPORT_ProductDataEnrichment stg with (nolock) where stg.eai_batchid = and coalesce(stg.fse_mfrID,0) > 0 and coalesce(stg.fse_importStatus,'') <> 'Mapped' and (nullif(stg.GTINItem,'') is not null or nullif(stg.GTINBox,'') is not null or nullif(stg.GTINCase,'') is not null or nullif(stg.GTINPallet,'') is not null or nullif(stg.mfrSkuCode,'') is not null) select p.linkid, s.mfrid, s.sku, s.skuid from tbl_PRD_Packaging p with (nolock) inner join tbl_PRD_Skus s with (nolock) on s.skuid = p.linkId and s.mfrId = where p.fsl_tableCode = and p.ownerid = and p.linkType = 'SKU' and (p.#i# = and nullif(p.#i#,'') is not null) update stage set stage.fse_skuId = , stage.fse_importStatus = 'Mapped', stage.fse_importStatusComments = '#_statusResults# item mapped via #i#' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = select p.linkid, s.mfrid, s.sku, s.skuid from tbl_PRD_Packaging p with (nolock) inner join tbl_PRD_Skus s with (nolock) on s.skuid = p.linkId and s.mfrId = where p.fsl_tableCode = and p.ownerid = and p.linkType = 'SKU' and nullif(p.gtin_item,'') is null and nullif(p.gtin_box,'') is null and nullif(p.scc14,'') is null and nullif(p.pallet_upc,'') is null and (s.sku = or s.mfrsku = ) update stage set stage.fse_skuId = , stage.fse_importStatus = 'Mapped', stage.fse_importStatusComments = '#_statusResults# item mapped via Sku' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = select p.linkid, s.mfrid, s.sku, s.skuid from tbl_PRD_Packaging p with (nolock) inner join tbl_PRD_Skus s with (nolock) on s.skuid = p.linkId and s.mfrId = where p.fsl_tableCode = and p.ownerid = and p.linkType = 'SKU' and (p.scc14 = and nullif(p.scc14,'') is not null) update stage set stage.fse_skuId = , stage.fse_importStatus = 'Mapped', stage.fse_importStatusComments = 'Mapped via GTIN Case' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = update stage set stage.fse_skuId = , stage.fse_importStatus = 'SKIP', stage.fse_importStatusComments = '#_dups#' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = select p.linkid, s.mfrid, s.sku, s.skuid from tbl_PRD_Packaging p with (nolock) inner join tbl_PRD_Skus s with (nolock) on s.skuid = p.linkId and s.mfrId = where p.fsl_tableCode = and p.ownerid = and p.linkType = 'SKU' and (p.gtin_item = and nullif(p.gtin_item,'') is not null) and #attributes.datasource#.dbo.RemoveChars(s.MfrSku,'32,39,40,41,45,47,92') = and nullif(s.MfrSku,'') is not null and nullif(p.gtin_box,'') is null and nullif(p.scc14,'') is null and nullif(p.pallet_upc,'') is null update stage set stage.fse_skuId = , stage.fse_importStatus = 'Mapped', stage.fse_importStatusComments = 'Mapped via Sku and GTIN Item' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = update stage set stage.fse_skuId = , stage.fse_importStatus = 'SKIP', stage.fse_importStatusComments = '#_dups#' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = select p.linkid, s.mfrid, s.sku, s.skuid from tbl_PRD_Skus s with (nolock) inner join tbl_PRD_Packaging p with (nolock) on s.skuid = p.linkId and p.linkType = 'SKU' where s.fsl_tableCode = and s.ownerid = and s.sku = and coalesce(p.gtin_box,'') = and coalesce(p.gtin_item,'') = and coalesce(p.scc14,'') = and coalesce(p.pallet_upc,'') = update tbl_IMPORT_ProductDataEnrichment set fse_skuId = , fse_importStatus = 'Mapped', fse_importStatusComments = 'Mapped via Sku, GTIN Item, GTIN Box, GTIN Case, GTIN Pallet' where eai_batchid = and eai_linenumber = update stage set stage.fse_skuId = , stage.fse_importStatus = 'SKIP', stage.fse_importStatusComments = '#_dups#' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = select s.skuid, s.sku from tbl_PRD_Skus s with (nolock) left outer join tbl_PRD_Packaging p with (nolock) on s.skuid = p.linkId and p.linkType = 'SKU' where s.ownerid = and s.fsl_tableCode = and s.mfrid = and ( ( #attributes.datasource#.dbo.RemoveChars(s.mfrSku,'32,39,40,41,45,47,92') = and nullif(s.mfrSku,'') is not null ) or ( #attributes.datasource#.dbo.RemoveChars(s.sku,'32,39,40,41,45,47,92') = and nullif(s.Sku,'') is not null ) ) and nullif(p.gtin_item,'') is null and nullif(p.gtin_box,'') is null and nullif(p.scc14,'') is null and nullif(p.pallet_upc,'') is null update tbl_IMPORT_ProductDataEnrichment set fse_skuId = , fse_importStatus = 'Mapped', fse_importStatusComments = 'Mapped via Sku(#qry_chkForMatch.skuid#)' where eai_batchid = and eai_linenumber = update stage set stage.fse_skuId = , stage.fse_importStatus = 'SKIP', stage.fse_importStatusComments = '#_dups#' from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and stage.eai_linenumber = update stage set netweight = null from tbl_IMPORT_ProductDataEnrichment stage where stage.eai_batchId = and isNumeric(netweight) = 0 select fse_skuid, count(*) from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and coalesce(fse_skuid,0) <> 0 and fse_skuRequestId is null group by fse_skuid having Count(fse_skuid) > 1 update tbl_IMPORT_ProductDataEnrichment set fse_importStatus = 'SKIP', fse_importStatusComments = 'DUPLICATE' where eai_batchid = and fse_skuid = and fse_importStatus <> 'SKIP' select GTINCase, fse_mfrid, count(*) dupCount from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and coalesce(fse_mfrid,0) > 0 and coalesce(fse_skuId,0) = 0 and nullif(GTINCase,'') is not null and fse_skuRequestId is null group by GTINCase, fse_mfrid update pde set fse_importStatus = 'SKIP', fse_importStatusComments = 'DUPLICATE - Identified by GTIN Case' from ( select *, row_number() over(partition by GTINCase order by (select null)) row_num from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and GTINCase = and fse_mfrid = and coalesce(fse_importStatus,'') <> 'SKIP' ) pde where row_num > 1 select GTINItem, mfrSkuCode, fse_mfrid, count(*) dupCount from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and coalesce(fse_mfrid,0) > 0 and coalesce(fse_skuId,0) = 0 and nullif(GTINItem,'') is not null and nullif(mfrSkuCode,'') is not null and fse_skuRequestId is null group by GTINItem, mfrSkuCode, fse_mfrid update pde set fse_importStatus = 'SKIP', fse_importStatusComments = 'DUPLICATE - Identified by GTIN Item and Sku' from ( select *, row_number() over(partition by GTINItem, mfrSKuCode order by (select null)) row_num from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and GTINItem = and mfrSKuCode = and fse_mfrid = and coalesce(fse_importStatus,'') <> 'SKIP' ) pde where row_num > 1 select mfrSkuCode, fse_mfrid, count(*) dupCount from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and coalesce(fse_mfrid,0) > 0 and nullif(mfrSkuCode,'') is not null and (nullif(GTINItem,'') is null and nullif(GTINBox,'') is null and nullif(GTINCase,'') is null and nullif(GTINPallet,'') is null) and fse_skuRequestId is null group by mfrSkuCode, fse_mfrid update pde set fse_importStatus = 'SKIP', fse_importStatusComments = 'DUPLICATE - Identified by Sku' from ( select *, row_number() over(partition by mfrSKuCode order by (select null)) row_num from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and mfrSKuCode = and fse_mfrid = and (nullif(GTINItem,'') is null and nullif(GTINBox,'') is null and nullif(GTINCase,'') is null and nullif(GTINPallet,'') is null) and coalesce(fse_importStatus,'') <> 'SKIP' ) pde where row_num > 1 select fse_skuid, eai_lineNumber, partnumberstatus from tbl_IMPORT_ProductDataEnrichment where eai_batchid = and (partnumberstatus not in ('A','R','C','N','D','Replaced','Active','Custom','Discontinued','Not Recognized') and nullif(partnumberstatus,'') is not null) update tbl_IMPORT_ProductDataEnrichment set fse_importStatus = 'SKIP', fse_importStatusComments = 'Invalid partnumber status' where eai_batchid = and eai_lineNumber = select stage.requestId, stage.fse_skuRequestId, stage.RequesterCompanyName, stage.RequesterItemNumber, stage.ManufacturerPartNumber, stage.PartNumberStatus , stage.MFRPartItemStyleModelNumber ManufacturerSecondaryPartNumber, stage.ManufacturerName, stage.ShortDescription, stage.LongTextProductDescription , stage.UnitsInCase GTINCaseQty, stage.UnitsperInnerPack, stage.InnerPacksInCase, stage.EANCategory, stage.RequesterItemNumber , stage.GTINItem, stage.GTINBox, stage.GTINCase, stage.GTINPallet, stage.EANCategory, stage.MaterialGroup, stage.ProductHierarchy, stage.GrossWeight, stage.NetWeight, stage.Volume , stage.BrandOwner, stage.BrandName, stage.CountryofOrigin, stage.CorporateBrandType, stage.SummarySellingStatement, stage.GreenIndicator, stage.EcoLogo , stage.GreenSeal, stage.SaferChoice, stage.EnergyStar, stage.EnvironmentallyPreferred, stage.EnvironmentallyPreferredDescription, stage.PreConsumerRecycledContent , stage.PostConsumerRecycledContent, stage.TotalConsumerRecycledContent, stage.BPI, stage.SizeDimensions, stage.Length, stage.Width, stage.Height, stage.SecondarySizeDimension , stage.PrimaryMFRProductImageFileName, stage.PrimaryMFRProductImageURL, stage.SecondaryMFRProductImageFileName, stage.SecondaryMFRProductImageURL , stage.TertiaryMFRProductImageFileName, stage.TertiaryMFRProductImageURL, stage.MSDSFileName, stage.MSDSURL, stage.ProductVideoURL, stage.UNSPSCCode , stage.Application, stage.ColorDesignColor, stage.ColorDesignFinish, stage.ColorDesignTheme, stage.DescriptiveSizeMopHeadSize, stage.DescriptiveSizeSizeGroup , stage.FunctionalProductGLOBALPRODUCTTYPE, stage.NumberofCompartments, stage.Packaging, stage.PackagingIntermediary, stage.PackagingType, stage.GTINBoxQuantity , stage.PhysicalCompositionChemicalCompound, stage.PhysicalCompositionExcludes, stage.PhysicalCompositionMaterials, stage.GTINPalletQuantity , stage.PhysicalFormCupType, stage.PhysicalFormDinnerwareType, stage.PhysicalFormDispenserType, stage.PhysicalFormFoodContainerType, stage.GTINCaseQuantity , stage.PhysicalFormHandSanitizersType, stage.PhysicalFormLidType, stage.PhysicalFormSoapType, stage.PhysicalFormTissueType, stage.PhysicalFormWasteReceptacleType , stage.PhysicalFormRimEdgeType, stage.PhysicalFormGaugeStrength, stage.PhysicalFormStyleType, stage.Scent, stage.TowelWipeType, stage.mfrSkuDesc , stage.ClosureType, stage.DilutionRatio, stage.NetworkMaterialNumber, stage.LastModifiedDate, stage.GTINBoxQuantity, stage.RequestedManufacturerUPC , stage.fse_mfrId, stage.eai_lineNumber, stage.eai_importId, stage.fse_cdrRecordId, stage.fse_skuid, stage.fse_mfrid, stage.fse_requestorType, stage.ERP2WebImage, stage.ERP2WebImageProcessDate , stage.MaterialType, stage.NSCProductLifeCycleStatus, fse_skuIdDuplicate, sr.status, sr.statusResult, stage.replacedByMfrNumber, stage.mfrSKuCode, stage.requestorDescription , coalesce(nullif(coalesce(nullif(mfrSKuCode,''), ManufacturerPartNumber),''),RequesterItemNumber) as backup_sku , coalesce(nullif(coalesce(nullif(mfrSkuDesc,''), requestorDescription),''),ShortDescription) as back_skuDesc from tbl_IMPORT_ProductDataEnrichment stage with (nolock) left outer join tbl_PRD_SkuRequestLink srl on srl.skuid = stage.fse_skuid left outer join tbl_PRD_SkuRequest sr with (nolock) on srl.skuRequestId = sr.skuRequestId where stage.eai_batchId = and stage.fse_mfrid IS NOT NULL and coalesce(stage.fse_importStatus,'') <> 'SKIP' ---> order by stage.fse_mfrid, stage.NetworkMaterialNumber select requestorBaseUOM, requestorSellingQty, requestorEANUPC from tbl_PRD_SkuRequest where ownerType = and ownerid = and skuRequestId = select s.skuid from tbl_PRD_Skus s with (nolock) inner join tbl_PRD_Packaging p with (nolock) on s.skuid = p.linkId and p.linkType = 'SKU' where s.fsl_tableCode = and s.ownerid = and s.sku = and coalesce(p.gtin_box,'') = and coalesce(p.gtin_item,'') = and coalesce(p.scc14,'') = and coalesce(p.pallet_upc,'') = insert into tbl_PRD_Skus(ownerid, fsl_TableCode, mfrid, sku, skudesc, systemSkuDesc, mfrSku, publishdate, unpublishDate, partNumberStatus, replacedBy, skuType, recordSource) values( , , , , , , , , , , , 'NA', 'NS MFR Loader Batch #attributes.batchId#') update tbl_IMPORT_ProductDataEnrichment set fse_skuid = , fse_importStatus = 'SKU ADDED', fse_importStatusComments = '#_partnumberstatus# Sku Added' where eai_batchId = and eai_lineNumber = insert into tbl_PRD_Packaging(fsl_tableCode,ownerid,linkType,linkid, EANUPC) values(, , 'SKU', , ) update tbl_IMPORT_ProductDataEnrichment set fse_skuId = , fse_importStatus = 'Mapped', fse_importStatusComments = 'MFR Dup Response' where eai_batchid = and eai_linenumber = update tbl_PRD_SKus set LastUpdate = getDate(), customFld_2 = convert(varchar(10), getdate(), 101), replacedBy = where fsl_tableCode = and ownerid = and skuid = update tbl_PRD_SKus set LastUpdate = getDate(), sku = , MfrSku = , skuDesc = , customfld_3 = , packSizeDesc = , MfrID = , CustomFld_6 = , CustomFld_4 = , SellingStatement = , EnvironmentallyPreferredDesc = , partNumberStatus = , productVideoURL = , skuType = , replacedBy = , customFld_2 = convert(varchar(10), getdate(), 101), productTypeId = 6, discontinued = 'N', publishdate = getDate(), unpublishdate = dateAdd(yy,12,getDate()), sortrank = 99 where fsl_tableCode = and ownerid = and skuid = update tbl_PRD_SKus set LastUpdate = getDate(), sku = , MfrSku = , skuDesc = , customfld_3 = , packSizeDesc = , publishdate = getDate(), unpublishdate = dateAdd(yy,12,getDate()), sortrank = 99, MfrID = , discontinued = 'N', CustomFld_6 = , productTypeId = 6, CustomFld_4 = , SellingStatement = , EnvironmentallyPreferredDesc = , partNumberStatus = , productVideoURL = , customFld_2 = convert(varchar(10), getdate(), 101), skuType = , replacedBy = where fsl_tableCode = and ownerid = and skuid = select packagingid from tbl_PRD_Packaging with (nolock) where fsl_tableCode = and ownerid = and linkType = 'SKU' and linkid = insert into tbl_PRD_Packaging(fsl_tableCode,ownerid,linkType,linkid) values(, , 'SKU', ) update tbl_PRD_Packaging set master_cube_unit = 'CF', scc14 = , Units_In_Case = , Units_Per_Inner_Pack = , master_gross_weight = , master_gross_weight_unit = 'lb', master_net_weight = , master_net_weight_unit = 'lb', master_height = , master_height_unit = 'in', master_width = , master_width_unit = 'in', master_length = , master_length_unit = 'in', master_cube = , master_unit_qty = , inner_packs_in_case = , pallet_upc = , country_of_origin = , eco_logo = , green_seal = , enviro_preferred = , energy_star = , pre_consumer_recycle_content = , post_consumer_recycle_content = , total_consumer_recycle_content = , msds_filename = , functional_prd_global_type = , packaging_comments = , packaging_intermediary = , packaging_type = , packaging_composition_chem = , packaging_composition_excld = , packaging_composition_matrl = , GTIN_BOX = , GTIN_ITEM = , BPI_Certified = , MASTER_UNIT_SIZE_DESC = , UNSPSC_Code = , SAFER_CHOICE = , Secondary_Size_Dimension = , Is_Green = , total_pallet = , date_stamp = date_stamp where fsl_tableCode = and ownerid = and linkType = 'SKU' and linkid = update tbl_PRD_Packaging set scc14 = , Units_In_Case = , Units_Per_Inner_Pack = , master_gross_weight = , master_gross_weight_unit = 'lb', master_net_weight = , master_net_weight_unit = 'lb', master_height = , master_height_unit = 'in', master_width = , master_width_unit = 'in', master_length = , master_length_unit = 'in', master_cube = , master_cube_unit = 'CF', master_unit_qty = , inner_packs_in_case = , pallet_upc = , country_of_origin = , eco_logo = , green_seal = , enviro_preferred = , energy_star = , pre_consumer_recycle_content = , post_consumer_recycle_content = , total_consumer_recycle_content = , msds_filename = , functional_prd_global_type = , packaging_comments = , packaging_intermediary = , packaging_type = , packaging_composition_chem = , packaging_composition_excld = , packaging_composition_matrl = , GTIN_BOX = , GTIN_ITEM = , BPI_Certified = , MASTER_UNIT_SIZE_DESC = , UNSPSC_Code = , SAFER_CHOICE = , Secondary_Size_Dimension = , Is_Green = , total_pallet = where fsl_tableCode = and ownerid = and linkType = 'SKU' and linkid = select linkid from tbl_PRD_OtherAttributes with (nolock) where ownerType = and ownerid = and linkType = 'SKU' and linkid = insert into tbl_PRD_OtherAttributes(ownerType,ownerid,linkType,linkid) values(, , 'SKU', ) update tbl_PRD_OtherAttributes set linkType = linkType, application = , DesignColor = , DesignFinish = , DesignTheme = , DescriptiveMopHeadSize = , DescriptiveSizeGroup = , NumberofCompartments = , FunctionalGlobalProductType = , Packaging = , PackagingIntermediary = , PackagingType = , PhysicalCompositionChemicalCompound = , PhysicalCompositionExcludes = , PhysicalCompositionMaterials = , PhysicalFormCupType = , PhysicalFormDinnerwareType = , PhysicalFormDispenserType = , PhysicalFormFoodContainerType = , PhysicalFormHandSanitizersType = , PhysicalFormLidType = , PhysicalFormSoapType = , PhysicalFormTissueType = , PhysicalFormWasteReceptacleType = , PhysicalFormGaugeStrength = , PhysicalFormStyleType = , Scent = , TowelWipeType = , PhysicalFormRimEdgeType = , ClosureType = , DilutionRatio = , MFRPartItemStyleModelNumber = , BrandOwner = , BrandName = , CorporateBrandType = , ownerType = ownerType where OwnerType = and ownerid = and linkType = 'SKU' and linkid = update tbl_PRD_OtherAttributes set application = , DesignColor = , DesignFinish = , DesignTheme = , DescriptiveMopHeadSize = , DescriptiveSizeGroup = , NumberofCompartments = , FunctionalGlobalProductType = , Packaging = , PackagingIntermediary = , PackagingType = , PhysicalCompositionChemicalCompound = , PhysicalCompositionExcludes = , PhysicalCompositionMaterials = , PhysicalFormCupType = , PhysicalFormDinnerwareType = , PhysicalFormDispenserType = , PhysicalFormFoodContainerType = , PhysicalFormHandSanitizersType = , PhysicalFormLidType = , PhysicalFormSoapType = , PhysicalFormTissueType = , PhysicalFormWasteReceptacleType = , PhysicalFormGaugeStrength = , PhysicalFormStyleType = , Scent = , TowelWipeType = , PhysicalFormRimEdgeType = , ClosureType = , DilutionRatio = , MFRPartItemStyleModelNumber = , BrandOwner = , BrandName = , CorporateBrandType = where OwnerType = and ownerid = and linkType = 'SKU' and linkid = update tbl_IMPORT_ProductDataEnrichment set #i#ImageURL = + #i#ImageFileName where eai_batchid = and nullif(#i#ImageFileName,'') is not null and nullif(#i#ImageURL,'') is null update tbl_IMPORT_ProductDataEnrichment set MSDSURL = + MSDSFileName where eai_batchid = and nullif(MSDSFileName,'') is not null and nullif(MSDSURL,'') is null update stage set stage.fse_importAction = fse_importAction + ' ' + 'Item Updated' from tbl_IMPORT_ProductDataEnrichment stage where stage.eai_batchId = and fse_skuid IS NOT NULL select imageErrors from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and imageErrors IS NOT NULL select stage.fse_skuRequestId, stage.partnumberstatus, stage.fse_skuId, stage.manufacturerPartNumber, stage.requestorDescription, stage.UOMsellingUnitQty, stage.baseUnitUOM, stage.RequestedManufacturerUPC, stage.manufacturerName, stage.fse_mfrId, stage.RequesterItemNumber, stage.fse_cdrRecordId, stage.fse_requestorType, stage.partnumberstatus from tbl_IMPORT_ProductDataEnrichment stage with (nolock) where stage.eai_batchId = and coalesce(stage.fse_skuRequestId,0) > 0 update sr set status = , statusResult = , dateCompleted = getDate() from tbl_PRD_SkuRequest sr where sr.ownerType = and sr.ownerID = and sr.skuRequestId = if not exists( select rowid from tbl_PRD_SkuRequestLink where skuRequestid = and skuid = ) insert into tbl_PRD_SkuRequestLink(ownerid, ownerType, skuRequestId, skuid, requestComments) values(, , , , 'MAPPED - #qmd_batch.batchid#') insert into tbl_PRD_SkuRequest( ownerType, ownerId, skuId, status, statusResult, requestorType, requestorId, createDate, initialStatus, dateRequested, dateCompleted, batchid, requestorMfrSku, requestorSkuDesc, requestorSellingQty, requestorBaseUOM, requestorEANUPC, requestorMfrName, mfrId, requestorSku, mappingStatus) values (, , , , , , , getDate(), 'NEW', getDate(), getDate(), , , , , , , , , , 'MAPPED - #qmd_batch.batchid#' ) insert into tbl_PRD_SkuRequestLink(ownerid, ownerType, skuRequestId, skuid, requestComments) values(, , , , 'MAPPED - #qmd_batch.batchid#') update sr set status = , statusResult = , dateCompleted = getDate() from tbl_PRD_SkuRequest sr inner join tbl_PRD_SkuRequestLink srl on sr.skuRequestId = srl.skuRequestId where sr.ownerType = and sr.ownerID = and srl.skuRequestId <> and srl.skuid = select stage.fse_mfrId, m.mfrAbbrev_Name, stage.fse_skuid from tbl_IMPORT_ProductDataEnrichment stage with (nolock) inner join tblManufacturers m with (nolock) on stage.fse_mfrId = m.mfr_id where stage.ownerType = and stage.ownerid = and stage.eai_batchid = and nullif(stage.fse_skuid,0) is not null Order by stage.fse_mfrId select categoryId from tbl_PRD_Categories with (nolock) where fsl_TableCode = and ownerId = and mfrId = and catnum = '001'; insert into tbl_PRD_Categories(ownerid, fsl_tableCode, mfrid, catnum, category, publishDate, unpublishDate, crmActive, prodLineID, sortRank) values(, , , '001', , , , 'Y', 0, 99); select prodid, inactive from tbl_PRD_Products with (nolock) where fsl_TableCode = and ownerId = and mfrId = and product = '001'; insert into tbl_PRD_Products(ownerid, fsl_tableCode, mfrid, product, shortdesc, publishDate, unpublishDate, crmActive, categoryid, sortRank, inactive) values(, , , '001', , , , 'Y', , 99, 0); update tbl_PRD_Products set inactive = 0 where fsl_TableCode = and ownerId = and mfrId = and prodid = update tbl_PRD_Skus set prodid = where fsl_tableCode = and ownerid = and skuid = and mfrid = select sr.skuRequestId from tbl_PRD_SkuRequest sr with (nolock) where sr.ownerType = and sr.ownerid = and sr.status in ('U','WS') No requests to process at this time. ('U','WS') select '' as row, ManufacturerName, s.partnumberstatus as status, mfrSKuCode as Sku, mfrSkuDesc as SkuDesc, RequesterItemNumber, requestorDescription, fse_importStatus, fse_importStatusComments as StatusComments, coalesce(fse_skuid,0) fse_skuid, stage.partnumberstatus as requestorStatus, fse_skuRequestId from tbl_IMPORT_ProductDataEnrichment stage with (nolock) left outer join tblManufacturers mfr with (nolock) on mfr.mfr_id = stage.fse_mfrid left outer join tbl_PRD_Skus s with (nolock) on s.skuid = stage.fse_skuid where stage.eai_batchId = order by mfr.mfr_name, mfrSku, Sku, fse_importStatus select row, ManufacturerName, status, Sku, SkuDesc, fse_importStatus, StatusComments, fse_skuid, fse_skuRequestId from qry_getResults order by ManufacturerName, Sku, fse_importStatus #_batchResults# $ProductDataRequestProcessor - #_PDRProcessor#