CTA的错误-Azure Synapse Analytics
我正在尝试使用CTA在Synapse SQL中创建一个临时表
IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp
CREATE TABLE #temp
AS SELECT [State], LocalizedLabel FROM StateMetadata WHERE EntityName ='incident'
,并获取错误消息
在关键字“ select”附近的错误语法。 总执行时间:00:00:00.533
如果我本身单独运行选择语句突出显示它的作品
SELECT [State], LocalizedLabel FROM StateMetadata WHERE EntityName ='incident'
,如果我不使用AS来创建temp表,则可以fine也是
IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp
CREATE TABLE #temp (
statecode int,
statecodename nvarchar(64)
)
SELECT * FROM #temp
我尝试了括号和一切。不知道我可能做错了什么。我是突触分析的新手,对此的任何帮助将不胜感激。
谢谢 尼迪
I am trying to create a temp table in Synapse SQL using CTAS
IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp
CREATE TABLE #temp
AS SELECT [State], LocalizedLabel FROM StateMetadata WHERE EntityName ='incident'
and getting an error message
Incorrect syntax near the keyword 'SELECT'.
Total execution time: 00:00:00.533
If I run SELECT statement by itself as highlighted it works
SELECT [State], LocalizedLabel FROM StateMetadata WHERE EntityName ='incident'
Select statement that works fine
and if I create temp table without using AS, it works fine as well
IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp
CREATE TABLE #temp (
statecode int,
statecodename nvarchar(64)
)
SELECT * FROM #temp
Create temp table without using AS
I have tried brackets and everything I could. Not sure what I am possibly doing wrong. I am new to Synapse Analytics, Any help on this would be highly appreciated.
Thanks
Nidhi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ctas
在创建时需要一个分发选项。使用 ctas 。CTAS
requires a distribution option while creating. Include distribution options while creating temp tables using CTAS.