DB Maintainence tasks using ssis
We have copy db backups from a server to another server and then restore the latest backup on that server. I am trying to enhance this ssis package to copy only
those backups that do not exist in the destination folder and save it on destination server and copy the latest backup on the server.
Thanks
November 2nd, 2010 8:29pm
You will need to iterate over the files in the destination folder and compare the names to your most recent backup file in the source.
This is doable by using the For-Each Loop Container. A workable example is -
http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx
and here -
http://www.rad.pasfu.com/index.php?/archives/22-Looping-through-specific-files-SSIS.html
Please bear in mind your expression would need to accommodate your back up file naming convention.
Option #2 is to use a Script Task. A good example is here -
http://timmitchell.net/post/2010/08/23/ssis-conditional-file-processing-in-a-foreach-loop.aspxArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
November 2nd, 2010 11:22pm
Thanks for your inputs.........
November 4th, 2010 6:02pm