Updated generateSql tool