﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Integration Services / Data Warehousing  / Looking for a way to move files from a dynamic source location to another dynamic archive location / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 05:28:27 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>Thank you very much for posting the detail of your final solution.  That'll really help other folks that are looking for a similar solution.This is also a very common task that people ask a lot of questions about.  You might want to consider writing an article on how to do this on this forum.  It's a chance to help others in a very public manner that would also look pretty good on future resumes to future employers.</description><pubDate>Wed, 20 Feb 2013 08:14:51 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>Add some screenshots and a sample Package people could download and you've got yourself a nice how-to article for SSC right there...just click the "Write For Us" link on the left nav ;-)</description><pubDate>Wed, 20 Feb 2013 08:12:27 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>OK so how did I do it, this is a simple step-by-step1)Load Input folder to variable use execute sql task (User::FileLocation)2)Load Archive folder to variable use execute sql task (User::ArchiveLocation)3)Fill a source path variable withe the following expression [code="other"]@[User::FileLocation] + "\\"[/code]4)[code="other"]@[User::ArchiveLocation] + "\\"[/code]5)When using 'For each file loop' use script task to get filname[code="other"]        Dts.Variables("FL").Value = System.IO.Path.GetFileName(Dts.Variables("CSVFileName").Value.ToString())        Dts.TaskResult = ScriptResults.Success[/code] User::FL is write variable,while User::CSVFileName is read-only (User::CSVFilename is the variable on which index 0 of the 'For Each File' task is mapped).6)Fill a variable User::MyFileValue with expression[code="other"]@[User::FL][/code]7)Fill a full source path variable using the following expression[code="other]@[User::SourcePath] +  @[User::MyFileValue][/code]8)Fill a full archive path variable using the following expression[code="other"]@[User::ArchivePath] + @[User::MyFileValue] [/code]9)Use a file system task 'Rename file' with 'full source path' a source and 'full archive path' as destinationThere are definitely corners to cut here but this works.</description><pubDate>Wed, 20 Feb 2013 07:48:07 GMT</pubDate><dc:creator>Resender</dc:creator></item><item><title>RE: Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>Nice work. Happy you found a way forward. Thanks for posting back.</description><pubDate>Wed, 20 Feb 2013 07:10:44 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>OK I found how to do it.Load the value of the location from the table into a variable.And then use that variable as an expression for the connectionstring for the flatfile source.</description><pubDate>Wed, 20 Feb 2013 07:01:04 GMT</pubDate><dc:creator>Resender</dc:creator></item><item><title>RE: Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>Sounds like you already did all the difficult parts of the processing you need to get done. A [u][url=http://msdn.microsoft.com/en-us/library/ms140185(v=sql.110).aspx]File System Task[/url][/u] should be all you need to move the file to the archive folder.</description><pubDate>Tue, 19 Feb 2013 07:27:58 GMT</pubDate><dc:creator>opc.three</dc:creator></item><item><title>RE: Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>Loads of examples of this all over the Internet, but try [url=http://stackoverflow.com/questions/7139172/how-to-create-a-package-that-would-copy-all-files-from-a-given-folder-into-a-new]this[/url] for starters &amp; see whether it helps.</description><pubDate>Tue, 19 Feb 2013 06:47:55 GMT</pubDate><dc:creator>Phil Parkin</dc:creator></item><item><title>Looking for a way to move files from a dynamic source location to another dynamic archive location</title><link>http://www.sqlservercentral.com/Forums/Topic1421539-364-1.aspx</link><description>I got the following situation:A database with a settings table and archive tables.(In the setting table we store the location for both input as archive folders)We get csv files in the archive folder.The ssis package we have so far reads in the source folder in a variable from the database.A for each loop runs through all the csv's in the folderA section from the filename is extracted using a script since we need to use that section as an indicator when the record was read in or updated.The data from the csv is read into the archive tablesNow I need to move the files from the source folder to the archive folder.How do I do this</description><pubDate>Tue, 19 Feb 2013 04:21:12 GMT</pubDate><dc:creator>Resender</dc:creator></item></channel></rss>