简体   繁体   English

使用SSIS将数据从SQL Server导出到Excel

[英]Export data from sql server to excel using SSIS

First I will explain what is my requirement and then I will explain what I have done so far and what are all the helps I need... 首先,我将解释我的要求,然后再解释到目前为止我做了什么以及我需要的所有帮助...

I have to export data from sql server to excel sheet. 我必须将数据从SQL Server导出到Excel工作表。 The excel sheet will be like a standard template . Excel工作表将类似于标准模板 If I run my project, the data from SQL Server should be inserted into a new excel file which should use that template and it should be created and saved into a new location. 如果运行我的项目,则应将来自SQL Server的数据插入一个新的Excel文件中,该文件应使用该模板,并且应将其创建并保存到新位置。 Also, generally we will use first row as header. 另外,通常我们将第一行用作标题。 But in my requirement, the template will have two or three rows header . 但根据我的要求,模板将具有两行或三行header So, the data should be inserted automatically from the third/fourth empty row. 因此,应该从第三/第四空行中自动插入数据。

I have done exporting data from sql server database to normal excel sheet with first row as header. 我已经完成了将数据从sql server数据库导出到普通的Excel表的工作,并以第一行作为标题。 I have also done exporting data from different tables into different sheets of the same excel file. 我还完成了将数据从不同表导出到同一excel文件的不同工作表的操作。

Any body please help out for the template format, creation of new excel file while running project and two or three rows as header. 任何机构请提供模板格式的帮助,在运行项目时创建新的excel文件,并以两行或三行作为标题。

I am using SQL Server 2005 and Visual Studio 2005. 我正在使用SQL Server 2005和Visual Studio 2005。

Please help out...Thanks in advance... 请帮忙...提前感谢...

如果导出到Excel 2007或2010,则可以使用EPPLUS处理Excel文件。

You can solve this using SSRS . 您可以使用SSRS解决此问题。

Create your report how it has to look like. 创建报告的外观。 Then deploy it on a reporting server web. 然后将其部署在报表服务器Web上。 Then create a subscription where you export the report to a excel file. 然后创建一个订阅,将报表导出到excel文件。 You can setup location and time it has to run. 您可以设置位置和运行时间。 THe report can look like however you need it. 报告可能看起来像您需要的。

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

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