azure上传excel

介绍 (Introduction)

There are great Microsoft tools to access to SQL Server in Azure. However, as a Database Developers and Administrators we need to help the end user to access to the information using a familiar and intuitive interface.

有许多很棒的Microsoft工具可以访问Azure中SQL Server。 但是,作为数据库开发人员和管理员,我们需要使用熟悉且直观的界面来帮助最终用户访问信息。

Most of the end users have a good knowledge in MS Excel. That is why it is recommended to connect our SQL Azure database to Excel. That way, the end user will be able to easily create reports, charts and generate useful information.

大多数最终用户对MS Excel都有很好的了解。 因此,建议将SQL Azure数据库连接到Excel。 这样,最终用户将能够轻松创建报告,图表并生成有用的信息。

In this chapter, we will show how to connect to SQL Azure using Microsoft Excel.

在本章中,我们将展示如何使用Microsoft Excel连接到SQL Azure。

要求 (Requirements)

I am assuming that you already have a VM in Azure installed.

我假设您已经在Azure中安装了VM 。

  • An Azure subscription.Azure订阅。
  • my article about Azure VMs).参阅有关Azure VM的文章 )。
  • A local machine with Windows installed.安装Windows的本地计算机。
  • The Adventureworks or any other database with tables and views already created. In this article, we will use the Adventureworks.Adventureworks或任何其他具有表和视图的数据库已经创建。 在本文中,我们将使用Adventureworks。
  • this article for details. A SQL Server authentication enabled and a SQL login and password.本文 。 已启用SQL Server身份验证以及SQL登录名和密码。
  • For this article, I am using Excel 2013, but the 2010 will work.对于本文,我使用的是Excel 2013,但2010版可以使用。

入门 (Getting started)

  1. Open the Microsoft Excel 2013.

    打开Microsoft Excel 2013。

    Figure 1. The Microsoft Excel图1. Microsoft Excel

  2. Go to the Data Menu and click the From Other Sources icon>From SQL Server.

    转到“ 数据”菜单,然后单击“ 来自其他来源”图标>“ 来自SQL Server”

    Figure 2. Connection to SQL Azure from Excel图2.从Excel连接到SQL Azure

  3. In the Azure Portal in the Virtual Machines section, verify the virtual machine name used. Copy and paste the virtual machine name to be used.

    在“虚拟机”部分的“ Azure门户”中,验证使用的虚拟机名称。 复制并粘贴要使用的虚拟机名称。

    Figure 3. The Azure Portal, retrieving the Server name in Azure.图3. Azure门户,检索Azure中的服务器名称。

  4. Paste the Azure virtual machine name with SQL Server and specify the SQL Server User name and the SQL Server Password.

    使用SQL Server粘贴Azure虚拟机名称,并指定SQL Server用户名和SQL Server密码。

    Figure 4. Login information to SQL Azure using the SQL Authentication图4.使用SQL身份验证登录到SQL Azure的信息

  5. Select a Database. In this example, we will use the AdventureWorks2014 database. There are two options here. You can connect to a specific table/view or you can select multiple tables. In this example, we will connect to a specific table.

    选择一个数据库。 在此示例中,我们将使用AdventureWorks2014数据库。 这里有两个选择。 您可以连接到特定的表/视图,也可以选择多个表。 在此示例中,我们将连接到特定表。

    Figure 5. 图5. Selecting the SQL Azure Database选择SQL Azure数据库

  6. Note that the icons for tables and views are different. You can also differenciate tables or views using the Type column.

    请注意,表和视图的图标不同。 您还可以使用“类型”列来区分表或视图。

    Figure 6. The tables and views图6.表和视图

  7. For this example, we will use the Employee table of the AdventureWorks database, but any table with data can be used for this test.

    在此示例中,我们将使用AdventureWorks数据库的Employee表,但是任何带有数据的表均可用于此测试。

    Figure 7.图7. The Employee tableEmployee表

  8. In Excel, an odc file is created to store the connection information. The ODC are Office Data Connection. You can specify where to store the file and specify a description, a friendly name and search keywords to search the files easily. Press the Browse button.

    在Excel中,将创建一个odc文件来存储连接信息。 ODC是Office数据连接。 您可以指定文件的存储位置,并指定描述,友好的名称和搜索关键字以轻松搜索文件。 按下浏览按钮。

    Figure 8. The odc file with the connection 图8. 带有连接 odc 文件

  9. By default, the ODC files are stored in my documents>my data sources folder, but you can specify the path of your preference.

    默认情况下,ODC文件存储在“我的文档”>“我的数据源”文件夹中,但是您可以指定首选项的路径。

    Figure 9. The 图9. odcodc file path文件路径

  10. If you open the file with a text editor, you will notice that it is a simple file with xml format and that it can be easily edited.

    如果使用文本编辑器打开文件,则会注意到它是xml格式的简单文件,并且可以轻松地对其进行编辑。

    Figure 10. The file content of the odc file 图10. odc 文件 的文件内容

  11. You can import the data in a table, PivotTable Report, PivotChart and only create the connection. You can create the data in the existing worksheet or in a new one.

    您可以将数据导入表,数据透视表报表,数据透视图中,并且仅创建连接。 您可以在现有工作表或新工作表中创建数据。

    Figure 11. How the SQL Server data will be displayed 图1 1 SQL Server数据 将如何显示

  12. Once you press OK, You will notice that the data from the employees table is now in Excel.

    单击确定后,您将注意到,employees表中的数据现在位于Excel中。

    Figure 12. The SQL Azure data in Excel

    图12 Excel中SQL Azure数据

  13. If you try to edit the data you will edit it in Excel, but the changes are not reflected in the SQL Server Azure table. You mainly have access to the data to create special reports that can be easily done in MS Excel.

    如果尝试编辑数据,则将在Excel中对其进行编辑,但是更改不会反映在SQL Server Azure表中。 您主要可以访问数据来创建特殊的报告,这些报告可以在MS Excel中轻松完成。

    Figure 13. Trying to edit the SQL data 图13 尝试编辑SQL数据

  14. You can also use filters as you do with normal data in MS Excel.

    您也可以像使用MS Excel中的普通数据一样使用过滤器。

    Figure 14. Using Excel filters with the SQL data图14.将Excel过滤器与SQL数据一起使用

  15. Now, let’s play with some formulas. Add the Age Column to the current table in Excel.

    现在,让我们玩一些公式。 将年龄列添加到Excel中的当前表。

    Figure 15. Adding a column to the table 图15 在表格中添加一列

  16. What we are going to do is to calculate the Age of a person using the birth date. We will do this using Excel. Add the following formula in the Age column:

    我们要做的是使用出生日期计算一个人的年龄。 我们将使用Excel进行此操作。 在“年龄”列中添加以下公式:

    =DATEDIF(G3,NOW(),”y”)

    = DATEDIF(G3,NOW(),“ y”)

    The formula shows the difference between the Birthdate column (G3) and the current date (NOW) in years (“y”).

    该公式显示“生日”列(G3)与当前日期(NOW)之间的年数(“ y”)之间的差异。

    Figure 16. Adding a Formula in Excel 图1 6 在Excel中添加公式

  17. As you can see, the Excel formulas can be easily used with the Azure data in SQL.

    如您所见,Excel公式可以轻松地与SQL中的Azure数据一起使用。

    Figure 17. The results of the formula applied 图17 应用公式的结果

  18. You can also create a nice dynamic reports using Power View. To access to Power View, select the data and go to the INSERT menu and select the Power View icon.

    您还可以使用Power View创建漂亮的动态报告。 要访问Power View,请选择数据并转到INSERT菜单,然后选择Power View图标。

    Figure 18. 图18. Enabling Power View启用Power View

  19. If it is your first time running Power View, it will ask you to enable it and install Silverlight (if it is not installed).如果这是您第一次运行Power View,它将要求您启用它并安装Silverlight(如果尚未安装)。
  20. Once enabled and installed, you will have a new Sheet in Excel with dynamic data.

    启用并安装后,您将在Excel中创建一个包含动态数据的新图纸。

    Figure 19. 图19. The Power View informationPower View信息

  21. You can create filters dynamically.

    您可以动态创建过滤器。

    Figure 20. 图20. Power View FieldsPower View字段

  22. In this sample, we will create a simple report, in this sample; we will see the graphs of males and female employees based on the Business Entity ID.

    在此示例中,我们将在此示例中创建一个简单的报告; 我们将根据业务实体ID查看男性和女性雇员的图表。

    Figure 21. 图21. Selecting columns to graph选择要绘制的列

  23. Select the Pie Chart option.

    选择饼图选项。

As you can see, the pie is created.

如您所见,创建了馅饼。

With Power View you can also create dynamic charts, working with geographical maps, etc. As you can see, working with SQL Server in an Azure VM using Excel is very easy.

使用Power View,您还可以创建动态图表,使用地理地图等。如您所见,使用Excel在Azure VM中使用SQL Server非常容易。

结论 (Conclusion )

As you can see, it is very easy to connect to SQL Server once the permissions are set. You can handle the SQL data to generate reports, graphs but not to edit the information. The connection is stored in odc files, which can be edited with any text editor. Excel 2013 with Power View enables you to create pretty nice dynamic reports.

如您所见,设置权限后,很容易连接到SQL Server。 您可以处理SQL数据以生成报告,图形,但不能编辑信息。 连接存储在odc文件中,可以使用任何文本编辑器进行编辑。 带有Power View的Excel 2013使您可以创建非常漂亮的动态报告。

翻译自: https://www.sqlshack.com/using-ms-excel-to-access-to-a-relational-sql-database-in-azure/

azure上传excel

azure上传excel_使用MS Excel访问Azure中的关系SQL数据库相关推荐

  1. JS 判断上传文件是否为EXCEL 文件

    <SCRIPT language="JavaScript"> function checkform(o){var f_content = form1.file.valu ...

  2. azure上传代码_深入了解Azure Data Studio:更多代码和更少GUI

    azure上传代码 In the previous two articles, Starting your journey with Azure Data Studio and Developing ...

  3. 微信公众号如何上传附件(Word、Excel、Pdf、PPT),三步轻松实现

    相信很多朋友都看到过,在公众号文章中的一些带蓝色图标的文字,点击时会弹出一个跳转到"附文件"小程序的提示窗,点击允许后,就可以跳转到"附文件"小程序下载附件. ...

  4. JQuery文件上传插件ajaxFileUpload在Asp.net MVC中的使用[转载]

    转载:https://www.cnblogs.com/fonour/p/ajaxFileUpload.html 0 ajaxFileUpload简介 ajaxFileUpload插件是一个非常简单的基 ...

  5. PHP上传文件函数move_upload,如何使用php中move_uploaded_file函数

    我们平时上传的文件保存在临时文件夹中,例如/ tmp,但临时文件夹的内容在一段时间后会被删除,因此为了将来要使用上传文件,需要将内容保存在不太可能被任意删除的专用目录中,这时就需要使用move_upl ...

  6. python 上传excel_简历批量合并Python+VBA小工具

    每年的校招,才是对招聘系统体验的真正大考. 如何帮HR快速标记.筛选成千上万的简历? 如何快速应答同学们的问询? 群面如何签到?如何自动分组? 怎样让候选人清楚面试流程与候场时间? 如何让面试官方便地 ...

  7. 【springboot】上传并解析excel表,使用postman测试上传文件,解决excel版本报错问题

    声明:博客代码只是实际项目的一部分,项目是前后端分离的,这篇博客中将记录如何使用工具类中提供的解析excel表格数据,并使用postman测试上传excel表的接口. 在项目pom.xml文件中添加依 ...

  8. PostMan测试接口-----上传文件、导出excel

    PostMan测试接口实现如下功能: (1)上传文件 (2)导出excel 一.PostMan测试接口实现上传文件 当测试接口需要上传文件时,我们依然可以借助Postman. 1.接口地址填写正确 2 ...

  9. 用python将图片上传到SM.MS图床

    最近项目要用到图床,找了一大堆之后选择了SM.MS图床,网上没有找到相关文档所以自己写一个. 官网提供上传APIhttps://sm.ms/doc/ import requestsurl='https ...

最新文章

  1. 计算机应用基础上机操作,计算机应用基础上机操作试题
  2. select 与c:forEach结合小案例
  3. 737 页《吴恩达深度学习核心笔记》发布,黄海广博士整理!
  4. C++的Android接口---配置NDK
  5. YFIOServer 后台IO接口使用说明
  6. 大白话,讲编程之《ES6系列连载》汇总,再也不用翻历史消息了
  7. iOS学习笔记15-设计模式之 适配器模式
  8. IAR for AVR delay函数
  9. linux识别科学计数法,Linux下科学计数法(e)转化为数字的方法 [shell中几种数字计算说明]...
  10. iOS 音乐播放器之锁屏效果+歌词解析
  11. spring与spring mvc
  12. mysql非阻塞通信协议_NIO 的非阻塞式网络通信
  13. 基于三极管的电平转换电路
  14. mysql mpm_mysql监控工具:zabbix+MPM(Performance Monitor for MySQL)
  15. React Native 仿 ofo 共享单车 App
  16. 仿高德地图首页效果,简单代码实现
  17. 对抗攻击经典论文——FGSM学习笔记 EXPLAINING AND HARNESSING ADVERSARIAL EXAMPLES
  18. 青少年CTF_misc部分题解
  19. Xshell连接服务器
  20. 华师在线计算机考试登陆不上,华师在线首页登录网址

热门文章

  1. sydney airport hotel recommendations
  2. 算法问题的解决 —— 预测答案结构(限制答案的形式)
  3. sed系列:行或者模式匹配删除特定行
  4. iOS下数据存储的方式
  5. 多个ORACLE HOME时的程序连接
  6. 我喜欢的歌-FOREVER
  7. Linux---僵尸进程的解决办法
  8. C++---vector与list之间的区别
  9. 【 Element UI 】—Element UI 的基本使用
  10. CCF CSSP202009-1称检测点查询