BEGIN TRAN
-- Convertion Tables
SELECT CURCON.* INTO MIG_CURRENCY_CONVERT  FROM CURR_CONVERT CURCON INNER JOIN ZZ_UDCDTYPE CUR ON CUR.VALUE_ID= CURCON.CURRENCY AND CUR.TYPE_NAME = 'UNCH_CURRENCY'
SELECT WEGCON.* INTO MIG_WEIGHT_UNIT_CONVERT  FROM WEIGHT_CONVERT WEGCON  INNER JOIN ZZ_UDCDTYPE WEG ON WEG.VALUE_ID= WEGCON.UNIT AND WEG.TYPE_NAME = 'UNCH_WEIGHT_UNIT'

-- List Tables
SELECT * INTO MIG_CURRENCY FROM ZZ_UDCDTYPE WHERE TYPE_NAME = 'UNCH_CURRENCY'
SELECT * INTO MIG_ITEM_GROUP  FROM ZZ_UDCDTYPE WHERE TYPE_NAME = 'UNCH_ITEM_GROUP'
SELECT * INTO MIG_PROD_CLS  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_PRODUCT_CLASS'  -- AND VALUE_ID<>0 AND VALUE_ID<>9
SELECT * INTO MIG_PROD_LNE  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_PRODUCT_LINE'
SELECT * INTO MIG_PROD_TYPE  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_PROD_TYPE'
SELECT * INTO MIG_SEL_CODE  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_SEL_CODE'
SELECT * INTO MIG_SIG_CODE  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_SIG_CODE'
SELECT * INTO MIG_UNIT_OF_MESR  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_UNIT_OF_MEASURE'
SELECT * INTO MIG_UNIT_SET  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_UNIT_SET'
SELECT * INTO MIG_WAREHOUSE  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_WAREHOUSE'
SELECT * INTO MIG_WEIGHT_UNIT  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_WEIGHT_UNIT'
SELECT * INTO MIG_MANUF  FROM ZZ_UDCDTYPE  WHERE TYPE_NAME = 'UNCH_MANUFACTURERS'


---- Table Names
--DROP TABLE MIG_CURRENCY
--DROP TABLE MIG_ITEM_GROUP
--DROP TABLE MIG_PROD_CLS
--DROP TABLE MIG_PROD_LNE 
--DROP TABLE MIG_PROD_TYPE
--DROP TABLE MIG_SEL_CODE
--DROP TABLE MIG_SIG_CODE
--DROP TABLE MIG_UNIT_OF_MESR
--DROP TABLE MIG_UNIT_SET
--DROP TABLE MIG_WAREHOUSE
--DROP TABLE MIG_WEIGHT_UNIT  
--DROP TABLE MIG_MANUF

--DROP TABLE MIG_CURRENCY_CONVERT
--DROP TABLE MIG_WEIGHT_UNIT_CONVERT




-- COMMIT TRAN
-- ABORT TRAN