简体   繁体   English

使用 ZD941BD232618B210Z2D8 从 SQL 服务器表复制数据到 excel 时需要合并列 header

[英]Need merged column header when copying data from SQL Server table to excel using SSIS

I have to create an SSIS package which will simply copy the data from SQL table to an Excel file.我必须创建一个 SSIS package ,它将简单地将数据从 SQL 表复制到 ZC1D4D81AF5839584ED8 文件。 The catch is I need a merged column for two columns in the first row and rest of the columns in the second row.问题是我需要第一行两列的合并列和第二行列的 rest。 Is this possible without keeping a template?如果不保留模板,这可能吗?

Screenshot:截屏:

在此处输入图像描述

Please advice!请指教! Thanks谢谢

Even though excel templates as destination will be the best solution, if you cannot go for excel templates you can think of below options:即使 excel 模板作为目标将是最好的解决方案,但如果您不能 go 用于 excel 模板,您可以考虑以下选项:

  • Save the open xml template as a variable.将打开的 xml 模板保存为变量。
  • Get the result into recordset destination.将结果放入记录集目的地。 Go for looping and Fill the rows inside Open xml template with recordset content, using script task, using C#. Go 用于循环并填充打开 xml 模板中的行,其中包含记录集内容,使用脚本任务,使用 C#。 Save the xml as.xlsx file.将 xml 保存为 .xlsx 文件。
  • Get the result into recordset destination.将结果放入记录集目的地。 Have script task and Fill all the rows inside Open xml template with recordset content, using C#.有脚本任务并使用 C# 用记录集内容填充 Open xml 模板中的所有行。 Save the xml as.xlsx file.将 xml 保存为 .xlsx 文件。

Refer to this SO post 请参阅此 SO 帖子

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

相关问题 使用SSIS将数据从Excel导入到SQL Server表 - Importing data from excel to sql server table using SSIS SSIS 将数据从 Excel 导出到 SQL Server 表 - SSIS Export data from Excel to SQL Server table 使用SSIS,如何将Excel工作表中的新数据插入到我现有的SQL Server表中 - Using SSIS, how to insert new data from Excel sheet into my existing SQL Server table 将数据从平面文件加载到 Sql 服务器表,并使用 SSIS 导出到 excel - Load data from flat file to Sql Server table and also export to excel using SSIS SSIS是Excel中的百分比列 - > SQL Server - SSIS the Percentage column from Excel -> SQL Server 使用SSIS将数据从SQL Server导出到Excel - Export data from sql server to excel using SSIS 使用 SSIS 从 Excel 加载数据到 SQL 服务器 - Load data from Excel to SQL Server using SSIS 使用SSIS DatFlowTask将数据从SQL Server导出到Excel时,如何避免“数字存储为文本”错误 - How to avoid 'number stored as text' error when exporting data from SQL Server to Excel using SSIS DatFlowTask 使用 ssis 从 SQL 服务器表复制到 Oracle 11g - Copying from SQL Server table to Oracle 11g using ssis SQL Server:在不使用游标的情况下将数据从表复制到另一个表 - SQL Server: Copying data from a table to another without using a cursor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM