如何在Microsoft PowerBI中使用SQL Server存储过程?

编程入门 行业动态 更新时间:2024-10-25 16:27:35
本文介绍了如何在Microsoft PowerBI中使用SQL Server存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想从我的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.

  • 应用这些更改后,您将在Power BI Desktop中看到用于创建报告的数据集。
  • 注意:此功能可在导入查询选项中使用。

    NOTE: This works in"Import Query" option.

    希望这对您有用对我来说,干杯!

    Hope this works for you as it did for me, Cheers!

    更多推荐

    如何在Microsoft PowerBI中使用SQL Server存储过程?

    本文发布于:2023-10-30 22:27:44,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1544188.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:存储过程   如何在   Microsoft   PowerBI   SQL

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!