Solved

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

Posted on 2010-11-11
4
629 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
ID: 34118596
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
ID: 34119569
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
ID: 34130740
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
ID: 34188794
Thanks!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help Required 2 30
SSRS 2012 r2 - Parm Drop Down has Date/Time 12 31
SQL SELECT query help 7 33
SQL Server - Set Field Values ito Zero Based on Related Table 4 22
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
I have a large data set and a SSIS package. How can I load this file in multi threading?
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

786 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