I was wondering whether it is possible to have a always encrypted Memory Optimized Table
and also have its Primary Key automatically seeded? For example, I want to create the following:
CREATE TABLE Foo
(
[Id] [int] Identity(1,1) NOT NULL,
[Bar] NVARCHAR(MAX) NOT NULL,
CONSTRAINT [PK_Foo] PRIMARY KEY NONCLUSTERED ([Id] ASC)
)
WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_ONLY)
GO
Fairly simple table and is initially created fine however, when I attempt to encrypt the column Bar
I get the following exception.
Apr 21 2017 09:23:00 [Error] WorkitemExecution: Message:Inner exception: System.Data.SqlClient.SqlException Details: Cannot insert explicit value for identity column in table 'Foo' when IDENTITY_INSERT is set to OFF..
I also tried setting SET IDENTITY_INSERT Foo ON
after the create table statement but still no luck.
Reading the documentation as well doesn't seem to suggest this isn't possible but perhaps I have missed something? If this isn't possible I have another approach which I know will work.
I guess my question in summary is.. "do Memory Optimized Tables support always encrypted with an identity column".