Solved

Exporting SQL Data - Naming CSV Export File

Posted on 2014-12-10
2
248 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:
SimonAdept earned 500 total points
Comment Utility
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
Comment Utility
Idk how I missed it. Thanks for pointing it out. I will test it and will let you know if needed.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

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

16 Experts available now in Live!

Get 1:1 Help Now