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.