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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors
Top Kudoed Authors