SSIS: Generate different file names based on run date when SSIS output flat files

Source: Internet
Author: User
Tags ssis

It is convenient to manipulate the input and output of files in SSIS, and this example illustrates one of the simplest requirements: for example, a daily query of data from a database to output to a file, a daily production of a file, then the file name according to the "filename + date" format to distinguish between, for example Employee20131225.txt.

My test data is very simple, is a query statement, to the output of these data to file and separated by commas, each file based on the time to distinguish.

SELECT EmployeeKey, Parentemployeekey, 

Employeenationalidalternatekey, 

FirstName + ' + LastName as FullName, 

Title from AdventureWorksDW2012.dbo.DimEmployee

Create a new SSIS Package with a data flow, create a data source table in the data flow using the SQL query statement above, and note that two variables are created first. A variable represents the directory of the output, and a variable represents the file name of the output. In my previous project, I also included the output of the server address, directory, classification and then enter the server address, directory classification and file name, etc., this example is simply demo.

Create a new flat file output Flat file destination This time, edit Ff_dst_employee prompts for the creation of a Files Connection manager.

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.