I was working with in-memory User Defined Table Types and got stuck on creating indexes on them.
Here's what I am trying to do:
CREATE TYPE dbo.CustomersTbl
AS TABLE
(
customerID int NOT NULL,
customerName nvarchar(100),
customerAddress nvarchar(100),
customerCity nvarchar(100),
customerEmail nvarchar(100)
INDEX IDX1 NONCLUSTERED (customerID) INCLUDE(customerName,customerAddress,customerCity)
)
WITH
(MEMORY_OPTIMIZED = ON);
This works fine if I do not include the INCLUDE part.
If this were a standard table I would create the index with the INCLUDE.
So my question, is there a way to create that index on the User Defined Table Type with the INCLUDE, or would there be a reason why I would not even want to? I am using these table types to create in-memory table variables.
I am currently using SQL Server 2017.