Forum Discussion
Can i call Stored Procedure with Direct Query?
Hey,
you can use the following SQL statement that you can enter accessing a SQL Server database in DirectQuery mode calling for the resultset returned by a T-SQL stored procedure
execute schemaname.procedurename
this SQL statement has to inserted where you normally provide your custom SQL statement.
I doubt that using a stored procedure will provide faster access to your SQL Server data.
I guess you are aware that directQuery does not load the data, instead a query is generated by Power BI, representing the interaction betwenn the user and the data.
In directquery mode there is something called "Query Folding", this will by no means happen if you use a stored procedure.
My recommendation
- Try to create a table that contains the necessary column for each table of your data model
- If you can't create a table, create a view in the database
- if 1 or 2 do not work try, to use SELECT ... FROM ... INNER JOIN ...
- Use Import instead of DirectQuery
Hope this helps somehow
Regards
Tom
- mehulvt8 years agoAdvocate I
Hi,
I get this error when I try to execute SP in direct query mode. SP has no parameters.
Incorrect syntac near keyword EXECUTE. Incorrect syntax near ')'
Does Power BI support SP call in direct query mode?
- Noak8 years agoHelper IV
I have the same problem
- Anonymous3 years agoNot applicable
I dear, do you know how I can correctly call a SAP HANA database storage procedure? I have this problem: