Solved

use an SSIS package to copy folders and rename them with FOLDER_YYYYMMDD

Posted on 2010-11-11
4
624 Views
Last Modified: 2013-11-10
I have seen several examples online where people are using the SSIS for each loop container to move \ copy files from one destination to another, however I need to copy folders from our primary storage to second tier storage. Currently all the databases backup to a primary storage device that is mapped as the [G:] drive. I need to copy all the folders that contain the database backups with the .bak and .trn files to my secondary (cheaper) storage at a UNC path.
Is there a way to do this with SSIS?
Thanks experts!
0
Comment
Question by:sqlagent007
4 Comments
 
LVL 9

Expert Comment

by:radcaesar
Comment Utility
Use Script task

Check the files in the folder using System.IO

If file exists in that folder move that using the method "File.Move(stcFileName, destFileName)"
0
 
LVL 16

Accepted Solution

by:
EvilPostIt earned 500 total points
Comment Utility
Use a filesystem task.

Please see below what options you have with a filesystem task. One of which is "Move Folder"

http://technet.microsoft.com/en-us/library/ms140185(SQL.100).aspx
0
 
LVL 30

Expert Comment

by:Reza Rad
Comment Utility
If folders which you want to copy and rename  has specified names you can simply use File System Task (  sometimes combined with Foreach Loop Container )
but if your folder names are not obvious, It is better to use Script task with System.IO classes.

I think this is better to tell us what you want to do exactly, with sample name of folders and we tell you right way.
0
 
LVL 1

Author Closing Comment

by:sqlagent007
Comment Utility
Thanks!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

771 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

10 Experts available now in Live!

Get 1:1 Help Now