Solved

SQL 2005 SSIS dynamic name for flat file export

Posted on 2009-07-15
2
684 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24858822
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
ID: 24865548
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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

732 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