Insert into Memory Optimized Table from non optimized

820 Views Asked by At

I have two database. Primary have a DDL triggers so i can't create memory optimized tables there. So i created secondary database and create there table with memory optimized on. Now, in procedure on primary database i need insert copy data from other table to this optimized.

For example:

INSERT INTO InMemory.dbo.DestTable_InMem SELECT * FROM @T;

And i have:

A user transaction that accesses memory optimized tables or natively compiled modules cannot access more than one user database or databases model and msdb, and it cannot write to master.

Did exists some workarounds from it?

I cannot move my procedure to second database.

1

There are 1 best solutions below

0
On

There is no other way than using a native procedure to INSERT, UPDATE or DELETE in an in-memory table.

See: A Guide to Query Processing for Memory-Optimized Tables

To move from one DB to the other, the source table must exists locally