#qmd_batch.resultsText# update fsr set fsr.fseCountryId = cntry.countryId from tbl_IMPORT_FoodServiceRewardsOperators fsr inner join tbl_UT_Countries cntry on cntry.country2dCode = case when fsr.fsrBusCountry = 'USA' then 'US' when fsr.fsrBusCountry = 'CAN' then 'CA' else 'OT' end where fsr.eai_batchId = and fsr.ownerId = and fsr.ownerType = set nocount on update fsr set fseTerritoryId = ter.territoryId from tbl_IMPORT_FoodServiceRewardsOperators fsr inner join ( select z3.zipcode_3d, ter.territoryId, ter.name from tbl_TER_Territories ter inner join tbl_TER_TerritoryLevels lvl on lvl.levelId = ter.levelId and lvl.zipCodeMapping = 'STANDARD' inner join tbl_TER_ZipCodeLink zcl on zcl.territoryId = ter.territoryId inner join tbl_UT_ZipCodes_3d z3 on z3.zip3d_id = zcl.zip3d_id where ter.ownerId = and ter.fsl_tablecode = ) ter on ter.zipcode_3d = left( fsr.fsrBusPostalCode, 3 ) inner join tbl_UT_Countries cntry on cntry.countryId = fsr.fseCountryId and cntry.country2dCode = 'US' where fsr.eai_batchId = and fsr.ownerId = and fsr.ownerType = and fsr.fseTerritoryId is null select rowsAffected = @@rowCount set nocount off select * from qmd_classifications order by sortRank desc
Processed #attributes.startLine + attributes.cycleSize - 1# lines, more to come...
Processed #attributes.startLine + attributes.cycleSize - 1# lines
#_processorOutputHTML# update tbl_IMPORT_FoodServiceRewardsOperators set tmpFirstSponsorRedemption = convert( datetime, left( fsrFirstSponsorRedemption, 2 ) + '/' + substring( fsrFirstSponsorRedemption, 3, 2 ) + '/' + right( fsrFirstSponsorRedemption, 4 )) where fsrFirstSponsorRedemption is not null and fsrFirstSponsorRedemption <> '' and ownerId = and ownerType = and eai_batchId = update tbl_IMPORT_FoodServiceRewardsOperators set tmpLastSponsorRedemption = convert( datetime, left( fsrLastSponsorRedemption, 2 ) + '/' + substring( fsrLastSponsorRedemption, 3, 2 ) + '/' + right( fsrLastSponsorRedemption, 4 )) where fsrLastSponsorRedemption is not null and fsrLastSponsorRedemption <> '' and ownerId = and ownerType = and eai_batchId = update opr set opr.foodservicerewardsLastDate = activity.fsrLastDate, opr.foodservicerewardsFirstDate = activity.fsrFirstDate from tbl_OPR_CLientOperators opr inner join ( select ownerId, ownerType, fseOperatorId, fsrBusinessId, min( tmpFirstSponsorRedemption) fsrFirstDate, max( tmpLastSponsorRedemption ) fsrLastDate from tbl_IMPORT_FoodServiceRewardsOperators where eai_batchId = and fseOperatorId is not null and tmpLastSponsorRedemption is not null group by ownerId, ownerType, fseOperatorId, fsrBusinessId ) activity on activity.fseOperatorId = opr.operatorId and activity.fsrBusinessId = opr.foodSErviceRewardsId and activity.ownerId = opr.ownerId and activity.ownerType = opr.fsltablecode where opr.ownerId = and opr.fsltablecode = --->