sqlserver batchset generation bug fixes