Solved

SQL 2005 SSIS dynamic name for flat file export

Posted on 2009-07-15
2
677 Views
Last Modified: 2013-11-10
I've got a SSIS package which extract data from a table and writes it to a flat text file nightly. I need the resultant file name to include the date it was extracted in the format YYYYDDMM

i.e. today's file would be called: Flat_file_20091507.txt

How do I ammend the SSIS package to dynamically name the file and what expression do I need to use to produce the date in this format?
0
Comment
Question by:Christie_M
2 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
this might help to get this done, using variables:
http://www.mssqltips.com/tip.asp?tip=1395
0
 
LVL 26

Accepted Solution

by:
Chris Luttrell earned 500 total points
Comment Utility
Here is the example you want to follow (look for this section a little over half way down the page):
"Here is an example of creating a dynamic flat file connection in SSIS. Let's say that every morning we load a textfile from the Receiving Department's network share into a database (for this we will use C:\backups\). The file is always processed the day after the receiving process and is named "DataLoad"+"month"+ "day"+"year.txt" (i.e., DataLoad10112006.txt). We are setting up an SSIS package that retrieves the data from the file and moves it to the database."
http://www.mssqltips.com/tip.asp?tip=1084
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now