博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
批量关停azure vm_如何从Azure VM数据库运行本地SQL报表
阅读量:2514 次
发布时间:2019-05-11

本文共 7201 字,大约阅读时间需要 24 分钟。

批量关停azure vm

介绍 ( Introduction )

In this new article, we will create a SQL Server Report using SQL Server Reporting Services from a SQL Server machine installed in an Azure Virtual Machine. We will show step by step how to connect from a local machine to a VM Azure Database and generate a SQL report.

在这篇新文章中,我们将使用Azure虚拟机中安装SQL Server计算机中SQL Server Reporting Services创建SQL Server报告。 我们将逐步展示如何从本地计算机连接到VM ​​Azure数据库并生成SQL报告。

要求 ( Requirements )

  • For the article, it is required the  installed.
  • 对于本文,需要安装 。
  • It will also be necessary the Azure subscription.

    也将需要Azure订阅。
  • ). We just need the Database installed. )。 我们只需要安装数据库。
  • A Server with the Windows OS installed locally.

    在本地安装Windows操作系统的服务器。
  • The installed in the local machine to generate the SQL Server Reports.
  • 安装在本地计算机上的的可生成SQL Server报告。
  • The SQL Server installed in the local machine (specially the SSRS).

    安装在本地计算机(特别是SSRS)中SQL Server。
  • The Adventureworks database installed on the VM Azure machine or any other database with tables and data already created. In this article, we will use the Adventureworks2014 database.

    安装在VM Azure计算机上的Adventureworks数据库或具有表和数据的其他任何数据库。 在本文中,我们将使用Adventureworks2014数据库。
  • It will be necessary a SQL Endpoint on the portal.

    门户上必须有一个SQL端点。
  • we will explain how to do it step by step. 我们将逐步解释如何做。
  • The SQL Server authentication enabled in Azure.

    在Azure中启用了SQL Server身份验证。
  • A SQL Account and a SQL password in Azure.

    Azure中SQL帐户和SQL密码。

入门 ( Getting started )

  1. Open the SSDT for Business Intelligence or the Visual Studio and in the menu, go to File> New Project.

    打开SSDT for Business Intelligence或Visual Studio,然后在菜单中转到“文件”>“新建项目”。

    Figure 1. The SSRS menu
    图1. SSRS菜单
  2. Select the Report Server Project Wizard.

    选择报表服务器项目向导。

    Figure
    2
    2
    .
    The reporting service Wizard
    报告服务向导
  3. The Welcome to the Report Wizard message will be displayed. Press next.

    将显示“欢迎使用报告向导”消息。 按下一步。

    Figure
    3
    . The Welcome wizard
    3
    欢迎向导
  4. To connect to the Azure Database, press the Edit button.

    若要连接到Azure数据库,请按“编辑”按钮。

    Figure 4. The Data Source connection information
    图4.数据源连接信息
  5. The server name is the name of the Azure VM. In this example, the name of the VM is olapsqldan.cloudapp.net. This name can be found in the Azure Portal. You will need to specify the SQL Server account created on the VM machine (in the requirements). Finally, we will specify the Database name. In this example, the database name is the Adventureworks2014. You can use other database from your preference.

    服务器名称是Azure VM的名称。 在此示例中,VM的名称为olapsqldan.cloudapp.net。 可以在Azure门户中找到该名称。 您将需要指定在VM计算机上创建SQL Server帐户(在要求中)。 最后,我们将指定数据库名称。 在此示例中,数据库名称为Adventureworks2014。 您可以根据自己的喜好使用其他数据库。

    Figure 5. The connection information to Azure
    图5.与Azure的连接信息
  6. Once the connection information is specified, press next.

    指定连接信息后,按下一步。

    Figure 6.
    图6.
    The credentials to Azure
    Azure的凭据
  7. You will be asked the SQL Server credential again. Once entered, press OK.

    系统将再次询问您SQL Server凭据。 输入后,按确定。

    Figure 7. The Data Source Credentials
    图7.数据源凭证
  8. The design the query window is used to write the query. You can write the query manually, copy and paste from other tools like the SQL Server Management Studio (SSMS) or use the Query Builder to create the query with friendly UI tools. We will press the Query Builder button in this example.

    设计查询窗口用于编写查询。 您可以手动编写查询,可以从其他工具(如SQL Server Management Studio(SSMS))复制和粘贴,也可以使用查询生成器通过友好的UI工具创建查询。 在此示例中,我们将按“查询生成器”按钮。

    Figure 8. The Query Builder
    图8.查询生成器
  9. In the query designer, press the option to add a table.

    在查询设计器中,按选项以添加表。

    Figure 9.
    图9.
    Adding a table in the Query designer
    在查询设计器中添加一个表
  10. Select the Department table (or any table of your preference) and press the Add button.

    选择“部门”表(或您偏好的任何表),然后按“添加”按钮。

    Figure 10.
    图10.
    Selecting tables
    选择表
  11. Select the columns that you want to be displayed in the report.

    选择要在报告中显示的列。

    Figure 11. Selecting columns
    图11.选择列
  12. If you have T-SQL knowledge, you could modify manually the queries done in steps 10 and 11. If not, just go to the next window.

    如果您具有T-SQL知识,则可以手动修改在步骤10和11中完成的查询。否则,请转到下一个窗口。

    Figure 12. The query string
    图12.查询字符串
  13. There are 2 options for the report type:

    报告类型有2个选项:

    1. Tabular, which will show the information in columns. This option has a fixed number of columns.

      表格,将在列中显示信息。 此选项具有固定的列数。
    2. Matrix, which will combine the information of rows and columns using dimensions. The number of columns depends on the results of the query.

      矩阵,它将使用维度合并行和列的信息。 列数取决于查询结果。

    In this example, we will use the Tabular option.

    在此示例中,我们将使用“表格格式”选项。

    Figure 13. The report type
    图13.报告类型
  14. You can separate or classify the reports in groups pages based on available fields. The next window will give us option to group the data and show which fields will be displayed. For example, we can create groups per groupname. In this example, we will use the default values and press next.

    您可以根据可用字段将报告分为组页面或进行分类。 下一个窗口将为我们提供将数据分组并显示要显示的字段的选项。 例如,我们可以按组名创建组。 在此示例中,我们将使用默认值,然后按下一步。

    Figure 14. The option to group data in reports
    图14.将数据分组到报表中的选项
  15. There are some few default styles in the report wizard. Slate, Forest, Corporate, Bold, Ocean and Generic. If you do not like any of these default reports, you can customize the reports later. In this example, we will use the Corporate style, but you can choose any other option. Once the style is chosen, press Next.

    报告向导中有一些默认样式。 板岩,森林,企业,粗体,海洋和通用。 如果您不喜欢这些默认报告中的任何一个,则可以在以后自定义报告。 在此示例中,我们将使用“公司”样式,但是您可以选择任何其他选项。 选择样式后,按下一步。

    Figure 15.
    图15.
    The different table styles
    不同的表格样式
  16. The Completing the wizard will display all the option chosen. You can review and verify that the Datasource, connection string, report type, layout type, style, details and the query are OK. Additionally, you can check the Preview report option to see a Preview of the report directly. In this example, we are going to enable this option. Once selected, press Finish.

    “正在完成”向导将显示所有选择的选项。 您可以查看并验证数据源,连接字符串,报告类型,布局类型,样式,详细信息和查询是否正常。 此外,您可以选中“预览报告”选项以直接查看报告的预览。 在此示例中,我们将启用此选项。 选择后,按完成。

    Figure 16. The last option of the wizard
    图16.向导的最后一个选项
  17. In this example, we are using the SQL Authentication to connect to the VM Azure Database. The report will ask the credentials of the step 5. Once the SQL login and the password is specified, execute the report.

    在此示例中,我们使用SQL身份验证连接到VM ​​Azure数据库。 该报告将询问步骤5的凭据。一旦指定了SQL登录名和密码,请执行该报告。

    Figure 17. The login and password requests
    图17.登录名和密码请求
  18. Once finished, you will have your report ready. You can edit, export to pdf, word, Excel or other formats of your preference.

    完成后,您将准备好报告。 您可以编辑,导出为pdf,word,Excel或您喜欢的其他格式。

结论 ( Conclusion )

As you can see, once you can connect to the VM in Azure the process to create local reports is very simple. You can work as a local database. The Internet speed will make the difference. If you need to work with large reports and your Internet connection is not fast enough, it can be a problem. However, besides the internet speed, you do not have restrictions. You can create charts, maps, KPIs or any other feature of your preference.

如您所见,一旦可以连接到Azure中的VM,创建本地报告的过程就非常简单。 您可以作为本地数据库。 互联网速度将有所作为。 如果您需要处理大型报表,并且Internet连接速度不够快,则可能会出现问题。 但是,除了互联网速度外,您没有任何限制。 您可以创建图表,地图,KPI或您喜欢的任何其他功能。

Once you have the connection to the Azure VM, the process to create reports is the same as a simple local report.

连接到Azure VM后,创建报告的过程与简单的本地报告相同。

翻译自:

批量关停azure vm

转载地址:http://qyiwd.baihongyu.com/

你可能感兴趣的文章
从远程库克隆库
查看>>
codeforces Unusual Product
查看>>
hdu4348 - To the moon 可持久化线段树 区间修改 离线处理
查看>>
springMVC中一个class中的多个方法
查看>>
cxx signal信号捕获
查看>>
《Android开发艺术探索》读书笔记——Cha3.2.3改变布局参数实现View的滑动
查看>>
python闭包与装饰器
查看>>
Acegi 源码解释
查看>>
Activity的几种启动跳转方式
查看>>
LCA最近公共祖先Tarjan(离线)
查看>>
牛客练习赛16 E求值
查看>>
matlab rank
查看>>
Asp.net系列--基础篇(三)
查看>>
css基础
查看>>
如何在tomcat中如何部署java EE项目
查看>>
【Python基础教程第2版】——第二讲:列表和元组
查看>>
小常识
查看>>
使用vscode开发python
查看>>
swift--调用系统单例实现打电话
查看>>
0038-算一算是一年中的第几天
查看>>