Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Markzolotoy
Impactful Individual
Impactful Individual

How to get data from a stored proc in DirectQuery mode

when I apply something like this:

exec sp1 in DQ mode I get this incorrect syntax near the keyword 'EXEC'. Incorrect syntax near ')'.

Next suggestion was use OpenQuery:

Gettin Error while loading the SP data using Direc... - Microsoft Power BI Community

First of all you need to configure SQL Server to allow Data Access. Which is already a huge problem: Try explaining to your client that you need to change his server settings. But for the sake of exercise I have modified my server. Here is the next error:

Details: "Microsoft SQL: Cannot process the object "EXEC dbname.dbo.sp_name". The OLE DB provider "MSOLEDBSQL" for linked server "servername" indicates that either the object has no columns or the current user does not have permissions on that object.

So, what is that?

Now, the reason for DQ is that as far as I know with Import if a user runs a paginated report than he is not getting the latest data unless he refreshes a dataset first. Ok, that be done. But what about a scheduled report export. Will that refresh a dataset automatically?

 

Thanks

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi @Markzolotoy ,

 

Check the reference below:

https://en.dirceuresende.com/blog/sql-server-and-power-bi-how-to-load-stored-procedure-data-into-sql...

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.