venkat113
SSC-Addicted
Points: 420
More actions
February 7, 2012 at 8:02 pm
#250440
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
sumitagarwal781
Default port
Points: 1493
February 7, 2012 at 10:15 pm
#1444277
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\'
Koen Verbeeck
SSC Guru
Points: 259115
February 8, 2012 at 2:18 am
#1444353
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.
But I have to admit the solution of sumitagarwal781 is a bit more elegant.
Need an answer? No, you need a questionMy 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