script to generate sql for loading data