Excel file at the end of the SSIS export date

Source: Internet
Author: User
Tags ssis

When you use the ETL tool to export data documents in Excel format periodically, you sometimes require that the exported file names end in the date or time of day to be differentiated or archived.

Microsoft's SSIS is also able to meet this requirement, with a focus of two:

1. Use variable to set the Excel file name

2. Using execute SQL Task to pre-set worksheet in Excel file (similar to how to build a table)

The following is the implementation process:

Set the properties of Excel Connection Manager excelfilepath to user-defined variable.

User-defined Variable:filepath, calculated as follows:

The above steps implement the effect of the exported Excel file name ending with the date of the day, but because the file is dynamically generated and not previously established, the runtime will have problems where the data flow does not know where the field is mapped.

Therefore, you also need to create a "Table" in Excel that matches the structure and field mappings, where execute SQL Task is used. In general, this control is run in the context of database, but here it is set to Excel and ConnectionType with the CREATE TABLE statement in Excel Connection The structure of the worksheet is established in the manager's corresponding file.

The following is the result of the operation:

Excel file at the end of the SSIS export date

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.