The following syntax seems to work. I've scripted for the dbo
schema. It is recommended that the BUCKET_COUNT
is set to ~1x-2x the unique values that will be held.
CREATE TYPE [SalesOrderDetailType_inmem] AS TABLE(
[OrderQty] [smallint] NOT NULL,
[ProductID] [int] NOT NULL
INDEX [IX_ProductID] HASH ([ProductID]) WITH ( BUCKET_COUNT = 8),
[SpecialOfferID] [int] NOT NULL
INDEX [IX_SpecialOfferID] NONCLUSTERED ,
[LocalID] [int] NOT NULL
)
WITH ( MEMORY_OPTIMIZED = ON )