file system task to create folders

  • Hi,

    I have a requirement to create a folder structure in a directory path say (c:\test) with the number of rows returned by my select statement...(like Select myname from mytable) if this query returns 10 rows then create 10 folders with names returned.

    How can i create folders based on rows returened by a query in SSIS.

    Any help on this...

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • Wow, thats an interesting request.. I question the methodology but ok..

    I would use a data-flow task. The rows are generated by a source and a script transform does the directory create..

    CEWII

  • Elliott Whitlow (12/9/2011)


    Wow, thats an interesting request.. I question the methodology but ok..

    I would use a data-flow task. The rows are generated by a source and a script transform does the directory create..

    CEWII

    I'd probably do this a little differently. Use an ExecuteSQL task to get the list of folders and assign that to an object variable.

    Feed that into a script task which iterates round the object variable and does the folder creations.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Elliott Whitlow (12/9/2011)


    Wow, thats an interesting request.. I question the methodology but ok..

    I would use a data-flow task. The rows are generated by a source and a script transform does the directory create..

    CEWII

    Why should you question a methodology that can bring down a server to it's knees? 😀

    (OK, NTFS can hold more than 4 million subfolders into one folder, but still...)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (12/12/2011)


    Elliott Whitlow (12/9/2011)


    Wow, thats an interesting request.. I question the methodology but ok..

    I would use a data-flow task. The rows are generated by a source and a script transform does the directory create..

    CEWII

    Why should you question a methodology that can bring down a server to it's knees? 😀

    (OK, NTFS can hold more than 4 million subfolders into one folder, but still...)

    I have had people say I'm crazy but thats just fine.. I think this methodology needs a bit more baking time before it is scrapped but it isn't near the worst I've seen and I didn't feel dirty answsering it. Unlike some where I simply will not give directions on how to do something flat out stupid. Sorry to be so blunt about it..

    CEWII

  • Elliott Whitlow (12/12/2011)


    I have had people say I'm crazy but thats just fine.. I think this methodology needs a bit more baking time before it is scrapped but it isn't near the worst I've seen and I didn't feel dirty answsering it. Unlike some where I simply will not give directions on how to do something flat out stupid. Sorry to be so blunt about it..

    CEWII

    No problem at all 🙂

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply