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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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