Solved

Exporting SQL Data - Naming CSV Export File

Posted on 2014-12-10
2
256 Views
Last Modified: 2016-02-15
Hello Exports,

I have a SSIS package created to export SQL Server 2012 data to a flat CSV file. I'm running the package using SQL Server Agent job. Everything works as anticipated and the data is exported. However, the file is stored as test.CSV and when the job runs the second time, the package overwrites the existing file.

Another application is picking up this CSV file and if it did not pick up this file before the SQL job runs the next time - the data will be lost. Is there a way I can specify file name, like current datetime (so it creates unique file names) when stored the CSV file on the screen attache below (see image)?

Please let me know how I can avoid this.

Thanks.SQLExport.jpg
0
Comment
Question by:appliedimg
2 Comments
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points
ID: 40492590
I suggest you look at this previous thread which explains it clearly:
Create dynamic file name for flat file destination
Basically, using an expression instead of a hard-coded connection string for your flat file destination.
0
 

Author Closing Comment

by:appliedimg
ID: 40492641
Idk how I missed it. Thanks for pointing it out. I will test it and will let you know if needed.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help  needed 3 23
SSRS  - Dropdown with Null 3 24
SQL Server Count where two id types exist in column 8 27
How to search for strings inside db views 4 26
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
A couple of weeks ago, my client requested me to implement a SSIS package that allows them to download their files from a FTP server and archives them. Microsoft SSIS is the powerful tool which allows us to proceed multiple files at same time even w…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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