刚刚安装了 SQL Server 2014。
直接来自文档的语法失败。
这失败了Sales
:
CREATE TYPE [Sales].[SalesOrderDetailType_inmem] AS TABLE(
[OrderQty] [smallint] NOT NULL,
[ProductID] [int] NOT NULL,
[SpecialOfferID] [int] NOT NULL,
[LocalID] [int] NOT NULL,
INDEX [IX_ProductID] HASH ([ProductID]) WITH ( BUCKET_COUNT = 8),
INDEX [IX_SpecialOfferID] NONCLUSTERED
)
WITH ( MEMORY_OPTIMIZED = ON )
但如果我删除Sales
它仍然失败
CREATE TYPE [SalesOrderDetailType_inmem] AS TABLE(
[OrderQty] [smallint] NOT NULL,
[ProductID] [int] NOT NULL,
[SpecialOfferID] [int] NOT NULL,
[LocalID] [int] NOT NULL,
INDEX [IX_ProductID] HASH ([ProductID]) WITH ( BUCKET_COUNT = 8),
INDEX [IX_SpecialOfferID] NONCLUSTERED
)
WITH ( MEMORY_OPTIMIZED = ON )
出现以下错误
消息 8135,级别 16,状态 0,行 10
表级别约束未指定列列表,表 'SalesOrderDetailType_inmem'。
如何创建内存优化表类型?