Forum Discussion
Why is DECLARE not supported (Error)?
- 10 years ago
Hi jsBrizius,
We reproduced same issue as yours. Power BI Desktop will always resolve the front end input SQL statement as a derived table. So when passing the SQL statement, the "Decalare"statement cause syntax error. See the fetched query in SQL profiler:
We have reported this issue internally.
Regards,
Hi,
I made a new function (new source ---> Blank query) and had same issue with this query:
let
UserNameSQL = Sql.Database("Servername","DatabaseName",[Query="EXEC [proj].[TestOrganisation2]"])
in
UserNameSQL
but i solved it by changing it to this:
let
UserNameSQL = () =>
Sql.Database("Servername","DatabaseName",[Query="EXEC [proj].[TestOrganisation2]"])
in
UserNameSQL
Hope it can help you guys :)
regards
- vissvess6 years agoHelper V
But what is this in case of Direct query..!
This converting the query into function and then invoking to a query and loading is converting the query to import mode..
What should I do for Direct query.- HarshVidap4 years agoFrequent Visitor
I have the same issue, were you able to find the solution?