Solved

SQL 2005 SSIS dynamic name for flat file export

Posted on 2009-07-15
2
690 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 27

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

634 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