question

ljbelanger avatar image
ljbelanger asked

Rename output file using a variable string by date

I am new to the SSIS Package in SQL 2008 and I am trying to find a variable string that will allow me to change a daily report output file name to include the file creation date at the end of the file name. The actual output file name should look like "XXXXJun26.csv" (where XXXX is the static file name & "Jun26" is the creation date). I found this string and tried to use it but it doesn't work as I had hoped: set @file_name='file_'+replace(convert(varchar(5),getdate(),104),'','') If you have suggestions or can direct me where I can find a solution it would be greatly appreciated.
sql-server-2008ssisoutput
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JohnM avatar image
JohnM answered
This article should give you some more insight: http://www.mssqltips.com/sqlservertip/1084/dynamic-flat-file-connections-in-sql-server-integration-services/ It's an older article around SQL Server 2005 SSIS, however the concepts should be the same. Or this one might work as well: http://jahaines.blogspot.com/2009/07/ssis-dynamically-naming-destination.html Hope this helps!
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the information John, I will take a look at it.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.