Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Adding a timestamp to files in SSIS - SQL School Video Expand / Collapse
Author
Message
Posted Saturday, September 13, 2008 10:18 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: Moderators
Last Login: Wednesday, June 4, 2014 12:29 PM
Points: 1,931, Visits: 234
Comments posted to this topic are about the item Adding a timestamp to files in SSIS - SQL School Video

Brian Knight
Free SQL Server Training Webinars
Post #569137
Posted Tuesday, September 16, 2008 4:56 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Wednesday, January 2, 2013 12:15 PM
Points: 1,443, Visits: 711
Brian,
Great video! Thanks!

Mark
Post #570079
Posted Wednesday, September 17, 2008 2:15 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, October 24, 2014 1:38 AM
Points: 292, Visits: 662
Brian,

I'm enjoying these videos, and learning some great stuff, keep them up.

Howard



Post #570806
Posted Thursday, September 18, 2008 1:30 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, August 6, 2012 1:17 AM
Points: 34, Visits: 150
Warning! Brian does point out that this technique may be no good if the file name needs to be known at a later stage in the package becuase the time will have changed (eg you need FTP or email the file somewhere), but doesn't explain how to fix this. My solution (I'm no expert though, so there might be a better way), is to create a package-level string variable, and at the start of the package use a script to set the value of the variable to be the required path and file name (including the time stamp). This variable can then be used to create the file and then subsequently for an FTP or email (or whatever) task.

Cheers - Graham



Post #571521
Posted Thursday, September 18, 2008 6:58 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, October 24, 2014 1:38 AM
Points: 292, Visits: 662
Brian did show us how to just user the date part for the file name and in most cases that would probably surfice, however, some packages may run into the next day so setting a package variable a the start would be a good idea.


Post #571732
Posted Thursday, September 18, 2008 7:34 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: Moderators
Last Login: Wednesday, June 4, 2014 12:29 PM
Points: 1,931, Visits: 234
You're right! If the package runs at 11:30PM and then tries to archive the file at 12:30 AM using my expression would fail for the archive, saying it can't find the file. One way around that is to lock in the expression on a variable instead using the EvaluateAsExpression property on the variable then tie that variable to the file name or by using a Script Task.

Brian Knight
Free SQL Server Training Webinars
Post #571776
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse