September 19, 2008 at 8:25 am
Afternoon,
This may seem something very simple for others, but i'm struggling as i new to ssis. so sorry if i have offended
I have a directory "D:\Downloaded Files\" That is static. What i what to be able to do is create a directory inside of that with the date when ever the ssis package runs.
So if the job ran today it would create a directory like this D:\Downloaded Files\20080919\
Any help would be great.
September 19, 2008 at 12:39 pm
In your file connection you can use expression to generate the folder name.
Expression- > connection String - > Use following expression
"D:\\Downloaded Files\\" +
(DT_WSTR, 4) DATEPART( "yy", getdate()) +
RIGHT("00" + (DT_WSTR, 4) DATEPART( "mm", getdate()),2) +
RIGHT("00" + (DT_WSTR, 4) DATEPART( "dd", getdate()),2)
HTH
~Mukti
September 19, 2008 at 5:11 pm
Ummm... will that create the sub-directory if it doesn't already exist?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 19, 2008 at 5:46 pm
I think i didin;t think through properly. The way to do this will be to have a variable that will generate the file name
"C:\\"+
(DT_WSTR, 4) DATEPART( "yy", getdate()) +
RIGHT("00" + (DT_WSTR, 4) DATEPART( "mm", getdate()),2) +
RIGHT("00" + (DT_WSTR, 4) DATEPART( "dd", getdate()),2)
Then use the variable as source in File System task to create the folder.
You can set the UseDirectoryIfExists property in File system Task editor according to your requirement.
September 20, 2008 at 7:38 am
Still, will that create a directory that doesn't already exist?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 22, 2008 at 12:47 pm
No, the file connection will not create the directory if it does not exist. You do that in a File System Task using the create directory operation. This is also where you can set the UseDirectoryIfExists option based on your needs.
We do this to archive files we transfer to a Managed Service Provider.
😎
September 22, 2008 at 5:53 pm
Lynn Pettis (9/22/2008)
No, the file connection will not create the directory if it does not exist. You do that in a File System Task using the create directory operation. This is also where you can set the UseDirectoryIfExists option based on your needs.We do this to archive files we transfer to a Managed Service Provider.
😎
Thanks Lynn.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply