(Incomplete) throwing sql when converting to bad sql if problem encountered