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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.