Set SQL after processing for better error messages