FIX: TRY…CATCH block rolls back too many transactions in some in-memory OLTP error handling scenarios in SQL Server 2016

Applies to: SQL Server 2016 DeveloperSQL Server 2016 EnterpriseSQL Server 2016 Enterprise Core


Consider the following scenario:

  • You use in-memory Online Transaction Processing (OLTP) in Microsoft SQL Server 2016.
  • You execute a natively compiled stored procedure (procedure A) to insert rows into a table. 
  • You execute another natively compiled stored procedure (procedure B) that calls procedure A multiple times in a TRY...CATCH block.
  • The first call to procedure A finishes inserting a row successfully. However, the subsequent call fails.

In this scenario, the execution results of all the calls to procedure A in the TRY…CATCH block are rolled back. However, the expected behavior is that only the results of the failed calls should be rolled back.


Service pack information for SQL Server 2016

This issue is fixed in the following service pack for SQL Server:

       Service Pack 2 for SQL Server 2016


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


Learn about the terminology that Microsoft uses to describe software updates.