How to split the files from dynamic folders into three folders

  • I have one folder that contains different files like .txt,xls files etc

    those files transfer into dynamic folders

    .txt files into D:/folder1

    .xls files into D:/folder 2

    LIKE THAT

    Pls help me

  • If you have only xls and txt files then you can simply use the below query to copy

    exec master.dbo.xp_cmdshell 'copy c:\source\*.txt D:\folder1\'

    exec master.dbo.xp_cmdshell 'copy c:\source\*.Xls D:\folder2\'

  • If you want to do everything with SSIS, you could use a For Each Loop with a file system task inside.

    One loop for .xls, one loop for .txt.

    LIKE THAT

    But I have to admit the solution of sumitagarwal781 is a bit more elegant.

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

Viewing 3 posts - 1 through 2 (of 2 total)

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