Search code examples
tsqlt

How can I test memory optimized tables using tSQLt?


Currently, when I try to unit test stored procedures using tSQLt, if my test touches a Memory Optimized table, I receive the following error:

(Error) Creating a savepoint is not supported with memory optimized tables.[16,98]
(There was also a ROLLBACK ERROR --> The current transaction cannot be committed and cannot be rolled back to a savepoint. 
 Roll back the entire transaction.{Private_RunTest,161})

I cannot find any docs in the wiki or elsewhere online that show the usage of In Memory tables with tSQLt, or a way to get around this issue.

Any thoughts or suggestions?


Solution

  • tSQLt currently requires the ability to rollback to a savepoint to work. However, savepoints are not compatible with MO tables, as the error states.

    I will look into options to change this, but that will require a major rework of the tSQLt engine, so I can't make any promises right now.