Solved

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

Posted on 2010-11-11
4
632 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

752 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