Flyway

SQL Server - Working with Memory Optimized Tables

If migration scripts are attempting to create, alter, or drop memory optimized tables, Flyway Desktop will automatically configure the generated Version and Undo scripts to run outside of a transaction.  If not, you will get the following error:  

SQL State : S000110
Error Code : 12331
Message : DDL statements ALTER, DROP and CREATE inside user transactions are not supported with memory optimized tables.


The Version and Undo script configuration file should reside alongside the corresponding migration script in the same directory.


In this example, V003 is adding a new memory optimized table.  The V003*.sql.conf and U003*.sql.conf have automatically been added.


The contents of both the U and V .sql.conf files are:

# Manually determine whether or not to execute this migration in a transaction. This is useful for
# databases like PostgreSQL and SQL Server where certain statements can only execute outside a transaction.
executeInTransaction=false


Learn more about script configuration files.


Didn't find what you were looking for?