简体   繁体   English

如何将表从Microsoft SQL Server导出到Excel?

[英]How to export a table from Microsoft SQL Server to Excel?

I have set up an automatic job to run a query/report on Microsoft SQL Server. 我设置了一个自动作业,以在Microsoft SQL Server上运行查询/报告。 The job runs fine and produces the correct data. 作业运行正常,并生成正确的数据。 However, I am having trouble with what syntax to use in order to get the automatic query to transfer all of the report into an Excel spreadsheet and save it into my documents (if this is even possible..). 但是,我在使用什么语法来获取自动查询时遇到麻烦,以便将所有报告传输到Excel电子表格并将其保存到我的文档中(如果可能的话..)。

This has to be automatic and part of the Job as the query/report runs overnight. 这必须是自动的,并且作为查询/报告运行一整夜的工作的一部分。

Thanks! 谢谢!

1 - Open a New Excel 1-打开一个新的Excel

2 - Go to Data Tab 2-转到数据标签

3 - Select From Other Sources (Refer image attached) 3-从其他来源中选择(请参阅参考图像)

4 - Select From SQL Server (Refer image attached) 4-从SQL Server中选择(附加参考图像)

在此处输入图片说明

5 - Enter the Server authentication and connection details to proceed further 5-输入服务器身份验证和连接详细信息以继续进行

This would ask for your server details and authentication. 这将要求您提供服务器详细信息和身份验证。 Then it would be asking the range or a cell were the data to be linked or exported. 然后,它将询问范围或单元格是要链接还是要导出的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM