Importing Custom Code Data - Rich Products Notes: 12/07/2007 - Started using single table tbl_IMPORT_CustomCodes Need to add a tbl_IMPORT_CustomCodes_Staging as holding tank for CustomCodes Need to modify step 1 to move from the holding tank to the customcodes import table pre1. Import MS-Excel Data File into Richs(Dev) database within FSEDEV02. -- import using Data Source Type : Microsoft Excel 97-2000 -- no need for data transformation, simple import will do. pre2. Rename newly created db table -- tbl_IMPORT_June2007_CustomCodes pre3. Rename fields and add aux. fields -- rename ID to SKU -- rename Description to skuDesc -- rename CurrentCases to qty (change datatype to int, optional) -- add fields -- uniqueid (auto-identity) -- OperatorID (do NOT allow nulls, set default to zero) -- skuid (do NOT allow nulls, set default to zero) -- forecast_year (do NOT allow nulls, set default to appropriate year) -- forecast_month (do NOT allow nulls, set default to appropriate month using MM format - i.e. 09 for September) -- uploadedYN (do NOT allow nulls, set default to zero) -- summaryUpdated (do NOT allow nulls, set default to zero) *** for the fields to be added, I usually just copy from prior month, then check off to not allow nulls *** occasionally, empty record rows get into the import table, I usually run a quick query against the table DELETE FROM tbl_______ WHERE sku IS NULL STEP 1. Abbreviate SKU -- trim sku down to five chars, removed 'L ' from beginning of string STEP 2. Get skuid from FSL db -- for any skus not found in FSL, investigate *** if qty = 0, ok to discard record row *** if qty > 0, must create SKU if necessary, usually involves dialogue with Kathy McCrone and RPC. STEP 3. Get operator id based on sku *** this is the troublespot. Again, if qty = 0, ok to discard at this time, may not be optimal way to handle select * from tbl_MFR_TPF_Detail where productitemcode = '' order by forecast_year, forecast_month use above query to determine sku/operator match STEP 4. enter forecast data -- insert/update into FSLibrary.dbo.tbl_MFR_TPF_Detail STEP 5. update summary recs -- update tbl_MFR_TPF_Summary tables