Solved

Exporting SQL Data - Naming CSV Export File

Posted on 2014-12-10
2
274 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
[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 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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