SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Adding a timestamp to files in SSIS - SQL School Video


Adding a timestamp to files in SSIS - SQL School Video

Author
Message
Brian Knight
Brian Knight
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: Moderators
Points: 2607 Visits: 235
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
SuperDBA-207096
SuperDBA-207096
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1969 Visits: 711
Brian,
Great video! Thanks!

Mark
wildh
wildh
SSC-Addicted
SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)

Group: General Forum Members
Points: 420 Visits: 675
Brian,

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

Howard



Slabber
Slabber
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
Points: 92 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



wildh
wildh
SSC-Addicted
SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)SSC-Addicted (420 reputation)

Group: General Forum Members
Points: 420 Visits: 675
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.



Brian Knight
Brian Knight
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: Moderators
Points: 2607 Visits: 235
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search