Skip to content
Advertisement

Why Synapse is not working with my query?

I’m trying to use a query in Synapse Analytics from Azure, and when I use it I got the next error:

at Source ‘AgenciesInventoryQueryFromSynapsestg’: shaded.msdataflow.com.microsoft.sqlserver.jdbc.SQLServerException: Parse error at line: 1, column: 47: Incorrect syntax near ‘WITH’.

enter image description here

That’s weird for me cause I tested the query in Microsoft SQL Server Management before to add it to Synapse, and it works perfectly there, the query is the next one:

Any idea what is going wrong here? or any idea for a work around?

Advertisement

Answer

Currently this is not supported so is using Order By clauses. As a workaround you can use user-defined table functions, such as select * from udfGetData(), where a UDF in SQL would return a table. This query will produce a source table that you can use in your data flow.

Example: the below works fine in SSMS

enter image description here

But in ADF as Synapse source:

enter image description here

enter image description here

Workaround….

Create a user defined function as necessary, for example as below:

enter image description here

Use Select to get data from function.

enter image description here

enter image description here

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement