Some if syntax bug + script to import in temporary table and rename then when import done