cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

DIRECT QUERY SYNTAX ERROR WHEN SAME QUERY WORKS FOR IMPORT

WHEN RUNNING A STORED PROCEDURE FROM THE DATABASE THE DATA IS SHOWN AND IF IMPORTED WORKS. IF DIRECT QUERY THE DATA IS SHOW BUT WHEN YOU APPLY IS GIVES YOU A SYNTAX ERROR EVENTHOUGH THE ADVANCED QUERY EDITOR SAYS NO SYNTAX ERRORS. PLEASE SEE BELOW

 

 ADV EDITOR.JPGERROR.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: DIRECT QUERY SYNTAX ERROR WHEN SAME QUERY WORKS FOR IMPORT

Hi @MOOREJEFF

It seems you need to get the data by consuming SQL Server Stored Procedure, also SQL Server Stored Procedures has parameters which you need to pass dynamically.

 

There is a solution about execute Stored Procedure using Managed Parameters in Power BI.

But This feature will work only for Import Mode.

 

As for direct query mode, 

You may refer to the post below that makes use of OPENROWSET.

https://community.powerbi.com/t5/Desktop/Calling-SQL-stored-procedure-with-Direct-Query/td-p/224831

 

Best regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: DIRECT QUERY SYNTAX ERROR WHEN SAME QUERY WORKS FOR IMPORT

Hi @MOOREJEFF

which does "UPDATECOME1_2" refer to?

If it is a column name, you need change as below:

Query="select [1] from Order1"

select columnname from tablename

 

If error insists, could you share the screenshot with me for better analysis?

7.png

 

 

Best Regards

Maggie

Highlighted
Frequent Visitor

Re: DIRECT QUERY SYNTAX ERROR WHEN SAME QUERY WORKS FOR IMPORT

Capture1.JPGCapture2.JPGCapture3.JPGCapture4.JPG

Highlighted
Community Support
Community Support

Re: DIRECT QUERY SYNTAX ERROR WHEN SAME QUERY WORKS FOR IMPORT

Hi @MOOREJEFF

It seems you need to get the data by consuming SQL Server Stored Procedure, also SQL Server Stored Procedures has parameters which you need to pass dynamically.

 

There is a solution about execute Stored Procedure using Managed Parameters in Power BI.

But This feature will work only for Import Mode.

 

As for direct query mode, 

You may refer to the post below that makes use of OPENROWSET.

https://community.powerbi.com/t5/Desktop/Calling-SQL-stored-procedure-with-Direct-Query/td-p/224831

 

Best regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors