Forum Discussion
h4tt3n
4 years agoHelper V
DirectQuery SQL statement fails when starting with declare or with keywords
Hi, I am attempting to show real-time data from an Azure SQL database using DirectQuery. However, the data needs to be manipulated with a complex SQL query, not just a simple select. When copy-pa...
amitchandak
4 years agoSuper User
h4tt3n , can share where declare is used.
If you trying a proc/function code to return a table, that will not work, You can call SP of SQL server for that
refer
h4tt3n
4 years agoHelper V
amitchandak Thanks for replying
I noticed that the linked tutorial uses import, and not DirectQuery. Do you know if this will work in DirectQuery too?
My SQL statement contains a list of variable declarations and a row of common table elements, followed by a select query. No functions. It appears to be failing if I start it with anything else than the select keyword.
Cheers, Mike
- Ry882 years agoNew Member
You can't declare variables or use cte