我想从我的SQL Server表中生成报告。
I want to generate reports from my SQL Server tables.
我已经有了一些存储过程,可以用来生成报告。
I have some already made stored procedures that I would like to use to generate reports from.
只能通过重写查询来实现。
Only by rewriting the queries.
谢谢:)
推荐答案在Power BI中执行您的SP->
To execute your SP in Power BI-->
1。在SQL Server中,右键单击您的SP,然后选择执行。您的代码将被执行,并打开一个负责执行的新查询窗口。复制该查询。
1.In SQL Server right click on your SP and select Execute. Your code is executed and a new query window opens up which was responsible for execution. Copy that Query.
2。在Power BI查询编辑器中,选择新建源-> SQL Server。提供服务器和数据库后,在同一窗口中单击高级选项,将查询粘贴到打开的 SQL语句中。 选中使用完整层次结构导航,然后单击确定。
2.In Power BI Query Editor, select New Source-->SQL Server. After giving the server and database, in the same window click on "Advanced Options", paste the query in the "SQL Statement" that opened up. Check "Navigate using full hierarchy" and click OK.
3。您将看到仅在SP中传递的参数数据。
3.You will see data for the parameters you passed in SP only.
注意:此功能可在导入查询选项中使用。
NOTE: This works in"Import Query" option.
希望这对您有用对我来说,干杯!
Hope this works for you as it did for me, Cheers!
更多推荐
如何在Microsoft PowerBI中使用SQL Server存储过程?
发布评论