sql-server - azure SQL 中 'CLUSTERED 附近的语法不正确
问题描述
嗨,我是分区概念的新手
在 azure SQL 中使用列存储索引创建表时,我遇到了类似的错误
消息 102,级别 15,状态 1,第 15 行 'CLUSTERED' 附近的语法不正确。
请找到我在 azure SQL 中运行的以下脚本
CREATE TABLE [dbo].[FactInternetSales]
(
[ProductKey] int NOT NULL
,[OrderDateKey] int NOT NULL
, [CustomerKey] int NOT NULL
, [PromotionKey] int NOT NULL
, [SalesOrderNumber] nvarchar(20) NOT NULL
, [OrderQuantity] smallint NOT NULL
, [UnitPrice] money NOT NULL
, [SalesAmount] money NOT NULL
)
WITH
( CLUSTERED COLUMNSTORE INDEX
, DISTRIBUTION = HASH([ProductKey])
, PARTITION ( [OrderDateKey] RANGE RIGHT FOR VALUES
(20000101,20010101,20020101
,20030101,20040101,20050101
)
)
)
;
解决方案
以下内容仅适用于标准 S3 层及更高版本。我无法设置分布和分区。
CREATE TABLE [dbo].[FactInternetSales]
(
[ProductKey] int NOT NULL
,[OrderDateKey] int NOT NULL
, [CustomerKey] int NOT NULL
, [PromotionKey] int NOT NULL
, [SalesOrderNumber] nvarchar(20) NOT NULL
, [OrderQuantity] smallint NOT NULL
, [UnitPrice] money NOT NULL
, [SalesAmount] money NOT NULL
)
GO
CREATE CLUSTERED COLUMNSTORE index ProductKey on FactInternetSales
推荐阅读
- ios - 如何使用响应式编程来订阅数据数组中的单项更改(插入或删除)?
- performance - Powershell脚本优化
- excel - 在 selenium VBA 的打开对话框中将密钥发送到文件名字段
- python - 如何使用 Raspberry Pi 解决有关 PiCamera 模块的 python 问题?
- python-3.x - 根据条件执行计算而不在 python 中指定列值
- java - 有没有可能用 JButton 计算
- git - 将工件添加到 gitlab-ci.yml 中的存储库
- scikit-learn - 关于通过将 random_state 值设置为整数来生成最佳决策树的困惑?
- php - 为什么我的查询结果将预期结果从“300”更改为上标“L”?
- java - 从 txt 读取二维数组列表