[FEATURE REQUEST] Add a way to execute batches that return ResultSets #2156
Labels
Backlog
The topic in question has been recognized and added to development backlog
Enhancement
An enhancement to the driver. Lower priority than bugs.
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
It is currently extremely difficult to do batch INSERTs when you need to get back the auto-increment row IDs (#245 has quite a few people complaining about this) or any other generated column. As far as I can tell, there are currently only two solutions:
It is currently not possible to use OUTPUT without INTO when using batched statements, because mssql-jdbc follows the JDBC spec, which specifically bans batched statements from returning ResultSets.
Describe the preferred solution
Create a way to execute batches that are allowed to return ResultSets. This could maybe be done by adding a config property that allows the driver to violate the JDBC spec during executeBatch(), or by adding a new executeBatchWithResults() method to ISQLServerStatement. That way, it's possible to use OUTPUT without INTO when using batched statements, which makes batch inserts a lot easier and provides a straightfoward (though vendor specific) workaround for #245.
The text was updated successfully, but these errors were encountered: