[英]SSIS - Script task to create xlsx file (Export data from sql database to new excel file)
I have data flow task, which import data from sql server to excel.我有数据流任务,它将数据从 sql 服务器导入到 excel。 Currently it requires to have excel templated in place, meaning that I have xlsx file with column names without data in my network location.
目前,它需要将 excel 模板化到位,这意味着我的网络位置中有列名没有数据的 xlsx 文件。 If I run the package the excel will be filled with data.
如果我运行 package excel 将充满数据。
What is needed: If I run ssis package I need new xlsx file to be created every time if package is executed.需要什么:如果我运行 ssis package 如果执行 package ,则每次都需要创建新的 xlsx 文件。 So I need to just create xlsx file with define columns every time and the xlsx file name should include date.
所以我需要每次只创建带有定义列的 xlsx 文件,并且 xlsx 文件名应该包含日期。
I imagine that I have to set up script task before data flow task, which just creates xlsx file.我想我必须在数据流任务之前设置脚本任务,这只是创建 xlsx 文件。 I am not very familiar with C#, I hope that someone could share the code what to use to achieve this.
我对 C# 不是很熟悉,我希望有人可以分享代码来实现这一点。
Or, you could create a folder and place a Template excel file with predefined format and no data.或者,您可以创建一个文件夹并放置一个具有预定义格式且没有数据的模板 excel 文件。
Every time the process runs, it must:每次进程运行时,它必须:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.