SSIS - Loop through files from a file path based on the value in the variable

Experts,
I have a requirement where I'll be loading multiple files in to a SQL server table and archive the files when loaded. However, the challenge is , the file path should be dynamic based on the value of a variable (say, @ProductName).
For example: If I am running the package for variable @ProductName="Product", the file path would be "\\....\Src\Product", in that case the ForEachLoop will loop through all the files in that folder, load them to the table and Archive
the files to the "\\....\Src\Product\Archive" folder.
Similarly, if the @ProductName="Product_NCP", the foreachloop container should loop through files in the "\\....\Src\Product_NCP" folder, load them to the table and archive them to the ""\\....\Src\Product_NCP\Archive"
folder.
Any suggestions? I should be able to run the package manually just by passing the "@Product" value, create Archive folder if it doesn't exist, load the data and archive the files.

Yes
1. Have a variable inside SSIS to get folder path. Set path based on your rule using an expression
like
(@[User::ProductName] == "Product" ? "\\....\Src\Product" : (@[User::ProductName] == "Product_NCP" ? \\....\Src\Product_NCP:..))
similary archive
(@[User::ProductName] == "Product" ? "\\....\Src\Product\Archive" : (@[User::ProductName] == "Product_NCP" ? "\\....\Src\Product_NCP\Archive" :..))
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • How to filter the Files from SharePoint Document Library based upon cloumn value

    Hi
    I should filter the files from document library. I have column called "Print Status" for the document library the value would be either "Yes" or "No".
    Now i should filter out the files which has "Print Status" as a "Yes".
    I am using SPFolder and SPFile from SharePoint Object Model to traverse the file in doc library.
    How could i do it?
    My Sample code:
    foreach (SPFolder childFolder in folder.SubFolders)
      if (childFolder.Name != "Forms")
        AspControls.TreeNode trn = new System.Web.UI.WebControls.TreeNode(childFolder.Name, "", "~/_layouts/images/itdl.gif", childFolder.ServerRelativeUrl.ToString(), "");
        newNode = TraverseFiles(childFolder, trn);
                                // add the new node to the tree
                                rootNode.ChildNodes.Add(newNode);
                        // loop through the files
                        foreach (SPFile childFile in folder.Files)
                            // create a new node and add to the tree
                            AspControls.TreeNode childNode = new System.Web.UI.WebControls.TreeNode(childFile.Name + " (" + childFile.TimeLastModified.ToShortDateString()
    + ")", Convert.ToString(childFile.Item["ID"]), "~/_layouts/images/" + childFile.IconUrl, childFile.ServerRelativeUrl.ToString(), "");
                            rootNode.ChildNodes.Add(childNode);
    Thanks
    Poomani Sankaran.

    Why do you transvers the file an not use a camp query? In a CAML query you can filter the print status and are able to get all files and folder objects at once.
    Check out the following post: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8c45b5e2-1fb8-435c-a97d-1d8c6d288d4c/caml-query-to-query-all-the-files-and-folders-in-document-library?forum=sharepointdevelopmentprevious
    Kind regards
    Stefan
    http://www.n8d.at/blog
    Follow me on Twitter: StFBauer |
    n8design
    Microsoft Community Contributor 2011 / 2012
    MCTS - SharePoint / WSS Configuration and Development

  • How to download a file from a server path?

    Is it possible to attach files on the server to a web dynpro response with cl_wd_runtime_services=>attach_file_to_response? All the examples I have seen assume you have the file content as an XSTRING. But how can one just send a file from a known path?
    Is it really necessary to first load the file (e.g. a 50Mb TIFF) as an XSTRING before downloading it? If so, how is this done?

    Hi Marc,
    Try using this FM to convert String to Xstring.
    SCMS_STRING_TO_XSTRING
    HR_KR_STRING_TO_XSTRING
    and also check this...Error document.getElementById(...)  in function 'SCMS_STRING_TO_XSTRING'
    Might Helps you.
    Cheers,
    Kris.

  • [svn] 4267: Change path to Assets.swf in eclipse . project file from full hardcoded path to use the FLEX_SDK variable as the base path .

    Revision: 4267
    Author: [email protected]
    Date: 2008-12-09 10:32:36 -0800 (Tue, 09 Dec 2008)
    Log Message:
    Change path to Assets.swf in eclipse .project file from full hardcoded path to use the FLEX_SDK variable as the base path. There is still an issue with Assets.swf not getting referenced correctly. If you import the framework project from Blazeds/trunk into Eclipse and get an error related to Assets.swf or that says "Unable to export SWC oem" for the time being try right clicking on the framwork project in Eclipse and selecting properties. Then in the properties panel, select Flex Library Build Path and then the Assets tab. On the Assets tab, check the check box next to Assets.swf and click Ok. This usually fixes the reference for me.
    Modified Paths:
    blazeds/trunk/development/eclipse/projects/flex/3.0/framework/.project

    Revision: 4267
    Author: [email protected]
    Date: 2008-12-09 10:32:36 -0800 (Tue, 09 Dec 2008)
    Log Message:
    Change path to Assets.swf in eclipse .project file from full hardcoded path to use the FLEX_SDK variable as the base path. There is still an issue with Assets.swf not getting referenced correctly. If you import the framework project from Blazeds/trunk into Eclipse and get an error related to Assets.swf or that says "Unable to export SWC oem" for the time being try right clicking on the framwork project in Eclipse and selecting properties. Then in the properties panel, select Flex Library Build Path and then the Assets tab. On the Assets tab, check the check box next to Assets.swf and click Ok. This usually fixes the reference for me.
    Modified Paths:
    blazeds/trunk/development/eclipse/projects/flex/3.0/framework/.project

  • Currency changes rates through TBEX from excel file getting erro

    Hi,
    When i am trying to upload the currency changes rates through TBEX from excel file getting error message:
    Error "The macro 'ThisWorkbook.TableBackToR3' cannot be f" occurred during macro execution
    Kindly guide what macro i need to define in excel sheet. or should i need to activate something in excel sheet relates to macros.
    Regards,
    Salil...

    When you call it the first time, it new Shell() constructs a new Display for you (the default).
    The second time, it gets the default display, but you are in a different Thread now. Since you have to create your widgets in the UI thread, it gives you that error.
    To run code in the UI thread, Display provides two methods:
    display.syncexec(..)and
    display.asyncexec(...)see
    http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/swt_threading.htm
    for more details.

  • Browsing and opening files from a file server

    Hello!
    I am interested if it is possible with AIR to browse files from a file server that is connected to a local network and open them. F.e. I want to create an application that opens template files with their native programs and save them on the file server under different name.
    Thank you in advance
    Lynda

    AIR 2 (now at labs.adobe.com) has features you are looking for. An AIR 2 application can open a file in the default system application registered for the file type. (The file server must be a mounted volume on the computer.)
    An extended desktop application (an AIR 2 application that is installed with a native installer) can communicate with another application. So, if the AIR (extended desktop) application knows the path to the native application, it can open that application and communicate with it. If the native application has APIs for opening and saving files, the AIR application can communicate with it using those APIs. (So, this functionality depends on the capabilities of the native application.)

  • Directly generate .exe file from .pc file

    Helllo
    i want to convert .PC to .EXE file.
    otherwise i have to go to pro*c/c++ then generate .C file and
    from that i have to generate .EXE file from Microsoft Visual c++.
    So can anybody suggest the exact way.
    Regards sourav

    Hi,
    Yes you can do it.
    In unix environment you have to write make file or you can use a sample make files provided by oracle in the below directory.
    /ORACLE_HOME/precomp/demo/proc
    The files are:
    demo_proc64.mk
    demo_proc32.mk
    demo_proc.mk
    In windows environment you will have to set the path for below two library files.
    (Oracle 9i)
    oraSQL9.lib
    oraSQLX9.lib
    You can find these files in (ORACLE_HOME\precomp\lib\msvc) folder on your PC.
    and also you have to do some more setting in Visual C++ editor. I am unable to recollect all the setting now, because i don't have windows environment.
    I am sorry i cant help you for windows environment. If you have unix env i can help you more.
    Regards

  • How can I move a pdf file from my pc to my ipad without overwriting all the pdf files in my ipad?

    How can I move a single pdf file from my pc to my ipad without overwriting all the pdf files already in my ipad?

    Email PDF to iPad.

  • HT201250 Is there a possibility to recover erased files from an external hard drive that was reformatted by the Time Machine?

    Is there a possibility to recover erased files from an external hard drive that was reformatted by the Time Machine?

    Basics of File Recovery
    Files in Trash
    If you simply put files in the Trash you can restore them by opening the Trash (left-click on the Trash icon) and drag the files from the Trash to your Desktop or other desired location.  OS X also provides a short-cut to undo the last item moved to the Trash -press COMMAND-Z.
    If you empty the Trash the files are gone. If a program does an immediate delete rather than moving files to the Trash, then the files are gone.  Recovery is possible but you must not allow any additional writes to the hard drive - shut it down. When files are deleted only the directory entries, not the files themselves, is modified. The space occupied by the files has been returned to the system as available for storage, but the files are still on the drive. Writing to the drive will then eventually overwrite the space once occupied by the deleted files in which case the files are lost permanently. Also if you save a file over an existing file of the same name, then the old file is overwritten and cannot be recovered.
    General File Recovery
    If you stop using the drive it's possible to recover deleted files that have not been overwritten by using recovery software such as Data Rescue II, File Salvage or TechTool Pro.  Each of the preceding come on bootable CDs to enable usage without risk of writing more data to the hard drive.  Two free alternatives are Disk Drill and TestDisk.  Look for them and demos at MacUpdate or CNET Downloads.
    The longer the hard drive remains in use and data are written to it, the greater the risk your deleted files will be overwritten.
    Also visit The XLab FAQs and read the FAQ on Data Recovery.

  • How do you separate corrupt files from good files on a external hard drive importing them to my macbook pro

    how do you separate corrupt files from good files on a external hard drive importing them to your macbook pro

    You open them one at a time into thier respective programs and see if they are good or not and then send the bad ones to the Trash and the good ones to the appropriate folder.

  • Hello, I have a Mac computer with NVIDIA 750M dedicated graphics card and monitor EIZO but the problem was there when I was working with Windows and Acer monitor. When I open a file from Camera Raw in PS this is smaller than the screen so I double-click w

    Hello, I have a Mac computer with NVIDIA 750M dedicated graphics card and monitor EIZO but the problem was there when I was working with Windows and Acer monitor. When I open a file from Camera Raw in PS this is smaller than the screen so I double-click with the tool "hand" to fit on the screen, but the picture loses sharpness and becomes blurry. If you magnify the image even only slightly with the tool "zoom" the picture comes back clear. In Camera Raw instead is always sharp. I solve the problem by turning off the graphics card in PS but often use plugin that need the graphics card otherwise the processing time is much longer. I ask for help.
    Thanks.

    Hello, I have a Mac computer with NVIDIA 750M dedicated graphics card and monitor EIZO but the problem was there when I was working with Windows and Acer monitor. When I open a file from Camera Raw in PS this is smaller than the screen so I double-click with the tool "hand" to fit on the screen, but the picture loses sharpness and becomes blurry. If you magnify the image even only slightly with the tool "zoom" the picture comes back clear. In Camera Raw instead is always sharp. I solve the problem by turning off the graphics card in PS but often use plugin that need the graphics card otherwise the processing time is much longer. I ask for help.
    Thanks.

  • I can't create PDF files from DWF files

    I'm looking for a solution for creating PDF files from DWF files. When I attempt to create a DWF file to PDF, the file has problems being created. Does anyone have a solution to this?

    We are trying to print to pdf format from a dwf (Autodesk Design Review) drawing file.  DWF is autodesk’s version of PDF.  In autocad, you can print to either dwf or pdf.  However, some of the fonts within autocad are not recognized by adobe so the fonts often don’t print properly.  Thus, we print to dwf first, then print again to pdf.
    We operate 2 basically identical computers; the one computer is able to print from dwf to pdf and the other is not.   When I say not able, only part of the drawing actually prints; like it is not able to process the data.  The computer that cannot print from dwf to pdf, can actually print directly to pdf from Autocad.    It just cannot print from dwf to pdf.
    Both computers are running Windows 7, Autocad Architecture 2015, and Adobe acrobat X. 
    Let me know if this is enough information.

  • Acrobat 11 doesn't create pdf. files from doc. files

    I tried to create a pdf. file from a doc. file (Office 2003). Acrobat 11 instead opens a warning message with the following contents (translated from German):
    A high security level has been chosen. Start the application that created the document, activate the dialogue "safety warning", choose "always trust macros from this resource, activate ... from Adobe Systems Inc. (the message aborts there).
    I selected "Extras/Macro/Safety/Safety level" , there I selected "low". The above mentioned message still comes up.
    What do you suggest to do in order to finally create pdf. files from doc. files?
    Additional information: Creating pdf. files from xls. files (Excel), txt. files (Editor) and saving a webpage as a pdf. file all work fine.
    Thanks for your input!

    Although Office 2003 is old compared to Acrobat XI, according to Compatible web browsers and PDFMaker applications it should work, though support has passed end of life.
    So my first test (if it were me) would be to see if PDFMaker works if run in the simplest way (the only way I ever use it, this right click conversion stuff isn't in my worldview). That is, does the Acrobat menu appear in Word and does it work? If it does not work, no other method based on it can work.

  • How to extract rpt file from .b1px file in SAP B1

    How to extract rpt file from .b1px file in SAP B1

    Hi Trupti,
    You will not be able to export .b1px file without importing in SAP B1.
    Please import .b1px file in SAP B1 and then export .rpt file from SAP B1 one by one.
    Hope this helps
    Regards::::
    Atul Chakraborty

  • How do I open files from an external drive?  It's plugged into the second slot to the end.

    How do I open files from an external drive?  It's plugged into the second slot to the end.  Did I plug it into the right place and how do I find the drive when trying to attach a file in an email? 

    Files on an external hard drive open just like files on the internal drive - but I get the idea that you are having a problem just finding and seeing those files. Is that correct?
    What operating system is running on your MacBook?

Maybe you are looking for

  • Hi, every sap guru's

    would u please tell me some answers to my questions 1)  what is the purpose of new gl account in ECC 6.0   2) what is the purpose of document splitting?   3) can u generate balancesheet report in fi using report painter? if it generate plz give me so

  • New Page in ALV for Value Change on a Field

    Is it possible to trigger a new page while prinitng from ALV whenever a value changes in a column. Thank you, Shashi Reddy

  • Error while starting weblogic server 7 sp7

    Hi I am getting below error when i am starting weblogic 7 .can anyone help me out. The WebLogic Server did not start up properly. Exception raised: java.lang.ClassCastException at weblogic.management.internal.xml.ConfigurationParser$ConfigurationHa n

  • [CS3][JS]Add Tag to text

    hi,    I need to apply tag to selected text in a layout.We can do it manually by selecting text in a layout and then choosing tag from 'Tags' window.The same thing needs to be done using Javascript.I have used the following code,but it adds tag to en

  • Can't update QT 7.6.4 to 7.6.6

    Jeesh! No matter what I do I just cant get the latest QT update to take. To avoid conflicts with QT X I had to move QT Pro 7.6.4 out of the Applications folder. The problem: Software Update didn't update QT Pro during the 10.6.3 go around. So I downl