[英]Azure Synapse Serverless SQL Pool Error: Incorrect syntax near 'DISTRIBUTION'
The following code on Azure Synapse Serverless SQL Pool gives the following error: Azure Synapse Serverless SQL Pool 上的以下代码会出现以下错误:
Incorrect syntax near 'DISTRIBUTION'. “分发”附近的语法不正确。
SELECT CM.EntityName,
--Before the first column of each table, construct a DROP TABLE statement if already exist
CASE WHEN CM.OrdinalPosition = 1
THEN
'DROP EXTERNAL TABLE MyTable' + '.' +
QUOTENAME(@EnrichedViewSchema) + '.' + CM.EntityName + '
CREATE TABLE MyTable' + '.' +
QUOTENAME(@EnrichedViewSchema) + '.' + CM.EntityName + '
WITH
(
DISTRIBUTION = ROUND_ROBIN
);
AS
SELECT DISTINCT '
ELSE ' ,'
END
Can someone look at the code and let me know where I might going wrong?有人可以查看代码并让我知道我可能哪里出错了吗?
Azure Synapse SQL Server Pool Error: Incorrect syntax near 'DISTRIBUTION'
Azure Synapse SQL Server 池错误:'DISTRIBUTION' 附近的语法不正确
CREATE TABLE MyTable' + '.' +
QUOTENAME(@EnrichedViewSchema) + '.' +
CM.EntityName + '
WITH
(
DISTRIBUTION = ROUND_ROBIN
)
Reference: screenshot from Microsoft document Design tables using Synapse SQL - Azure Synapse Analytics |
参考:Microsoft 文档Design tables using Synapse SQL 的屏幕截图 - Azure Synapse Analytics | Microsoft Learn
微软学习
there is an additional semicolon before AS in your script.脚本中的 AS 之前有一个额外的分号。
Wrong: CREATE TABLE XXX WITH(DISTRIBUTION=ROUND_ROBIN);错误:CREATE TABLE XXX WITH(DISTRIBUTION=ROUND_ROBIN); AS SELECT
作为选择
Correct: CREATE TABLE XXX WITH(DISTRIBUTION=ROUND_ROBIN) AS SELECT正确:CREATE TABLE XXX WITH(DISTRIBUTION=ROUND_ROBIN) AS SELECT
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.