Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 FTP TASK

Author  Topic 

h.singh10
Starting Member

16 Posts

Posted - 2012-01-23 : 12:45:38
Hi

I am creating a flat file (destination) in ssis with the naming convention (bh5601_yyyymmddhhmmss.bdf). Each day a file is created with different name.

I am using the following expression in the flatfile connection manager proerty box to give dynamic name to the file.

"C:\\Users\\Downloads\\bh5601_"+(DT_STR,4,1252)DATEPART( "yyyy" , @[System::StartTime] ) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "hh" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "mi" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "ss" , @[System::StartTime] ), 2)+".bdf"

It is working well. Now after the file is ctrated, i am using the FTP task to pick up that particular file and sent to remote path. I am able to configure the remote path but can any body telll me how to make local path dynamic.

Flat file is created everyday. so i want ftp task to pick up file with correct datetime stamp.

Please help.

Thanks

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2012-01-30 : 19:08:12
what makes the destination path dynamic? dev, sqa, staging , production. Where are the different sources of destination folder? etc. It is possible to do it in a dozen different ways..

If you don't have the passion to help people, you have no passion
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-30 : 19:48:58
quote:
Originally posted by h.singh10

Hi

I am creating a flat file (destination) in ssis with the naming convention (bh5601_yyyymmddhhmmss.bdf). Each day a file is created with different name.

I am using the following expression in the flatfile connection manager proerty box to give dynamic name to the file.

"C:\\Users\\Downloads\\bh5601_"+(DT_STR,4,1252)DATEPART( "yyyy" , @[System::StartTime] ) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "hh" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "mi" , @[System::StartTime] ), 2) +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "ss" , @[System::StartTime] ), 2)+".bdf"

It is working well. Now after the file is ctrated, i am using the FTP task to pick up that particular file and sent to remote path. I am able to configure the remote path but can any body telll me how to make local path dynamic.

Flat file is created everyday. so i want ftp task to pick up file with correct datetime stamp.

Please help.

Thanks




you can store the generated filename in a variable. Then use source path from variable property for ftp task and map it to above created variable

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -