Forum Discussion
eferreira
10 years agoNew Member
Use SQL Store Procedure in Power BI
I have created a basic stored procedure without parameters in SQL Server, when I use the store procedure in Power Bi Desktop the return is ok in design but when I click on Save and Close in datasourc...
Anonymous
10 years agoNot applicable
stangellapallyeferreiranirajdubeyasocorro As a follow up to my previous post, i was testing this further due to another thread, and have discovered that you don't need to change any database settings or use OpenQuery. If you wrap your stored procedure in a variable you can import the data using a sproc (Doesn't work in Direct Query, only import)
example:
DECLARE @sqlCommand varchar(1000)
SET @sqlCommand = 'dbo.Testproc'
EXEC (@sqlCommand)
premjitsaha
9 years agoFrequent Visitor
How to use it if SQl stored procedure has a parameter?
- Anonymous9 years agoNot applicable
premjitsaha Use dsilveira's solution above... Is there a different scenario you have in which it isn't working?
- premjitsaha9 years agoFrequent Visitor
thanks it worked