June 6, 2012 at 3:03 am
Hi,
Need to generate flat file using SSIS.
I have created packages and files were generated in a sepcific folder with current date.
If i executed the package five times today, it created only one file. But i needs five files with todays date.
Example :
D:\Sample\20120606Sample1.txt
D:\Sample\20120606Sample2.txt
D:\Sample\20120606Sample3.txt
D:\Sample\20120606Sample4.txt
D:\Sample\20120606Sample5.txt
Regards
SqlStud
June 6, 2012 at 3:27 am
This was removed by the editor as SPAM
June 6, 2012 at 3:29 am
No Stewart.
Only datepart given in the filename
June 6, 2012 at 3:34 am
Hi,
You can append a random number to the file. This will create files with unique names.
Select rand()
Thanks
~Vishwanath
June 6, 2012 at 4:18 am
I have used the output file format in expression properties
"\\"+ "\\Sample\\Shares\\Medical\\"+@V_Path+"\\MDM\\MDM_"+ (DT_WSTR,4)YEAR(GETDATE()) + RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()),2) + RIGHT("0" + (DT_WSTR,2)DAY(GETDATE()),2)+".csv"
How will i use Random number? Please suggest
Regards
SqlStud
June 6, 2012 at 4:46 am
This was removed by the editor as SPAM
June 6, 2012 at 4:59 am
Ok..
But the filename should append with numbers from 0-9
ie
Filename1.txt
Filename2.txt etc
Regards
SqlStud
June 6, 2012 at 6:09 am
This was removed by the editor as SPAM
June 6, 2012 at 1:02 pm
Not yet decided. but it will be at regular intervals
June 7, 2012 at 5:33 am
This was removed by the editor as SPAM
June 7, 2012 at 5:47 am
Thanks Stewart
🙂
June 8, 2012 at 2:23 pm
Hello - I had the same need and found this great link that solved it for me
http://www.sqlnerd.com/ssis_dynamic_dates.htm
good luck -
June 8, 2012 at 3:04 pm
You could include system.io in the script task and get the fullname of the file .Then get the last number using the for each loop for file . Get the new file name and save it .
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply