more robust sql import