Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi there,
I have read the comments on the relevant PBI forums about calling SQL stored procedures in DirectQuery mode, but it's not working for me. Could you please assist me validate the following syntax with an example for connecting a stored procedure in DirectQuery mode? Many Thanks.
select *
from
openrowset('SQLOLEDB','SERVER=SERVERNAME;Trusted_Connection=yes;',' set fmtonly off;
exec DATABASE..SPNAME
@StartDate=''2023-01-01'' ,
@EndDate=''2023-01-04'' ')
https://learn.microsoft.com/en-us/sql/t-sql/functions/openrowset-transact-sql?view=sql-server-2017
Hi @amitchandak, Thanks for sharing the information. I understand that we won't be able to pass parameters to stored procedures, and we can't execute them in direct query mode. We can however, create table valued functions which give us the ability to use table variables and perform other functions that are more complex in nature in 'DirectQuery' mode.
When I try to connect a stored procedure in SELECT from OPENROWSET from 'DirectQuery,' mode, I get the following error message. Thanks.
@TahmidBari , Both old tickets suggest openrowset option
https://community.powerbi.com/t5/Desktop/Can-i-call-Stored-Procedure-with-Direct-Query/m-p/267141
https://community.powerbi.com/t5/Power-Query/Stored-Procedures-in-Direct-Query-mode/td-p/2640876
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
86 | |
84 | |
83 | |
67 | |
49 |
User | Count |
---|---|
131 | |
111 | |
96 | |
71 | |
67 |