Forum Discussion
michaeljc70
10 years agoAdvocate II
Query with CTE gives error
I used SQL Server and a query that uses a CTE. It gives me an error "Incorrent syntax near the Keyword 'WITH'. ......."if this is a common table expression......previous statement must be terminated...
Anonymous
2 years agoNot applicable
I was able to get around this in the Snowflake Connector and get my CTE to work by editing the default Source function. It looks like it automatically sets a variable at the end that when I set to false it works.
= Value.NativeQuery(Snowflake.Databases("SERVER","WAREHOUSE"){[Name="DB"]}[Data], "YOUR QUERY HERE", null, [EnableFolding=true])
Try changing the last parameter to [EnableFolding=false]. This worked for me both getting the preview and the load to work. Strangely, at least one of my CTEs still worked with EnableFolding=true.