Get Filename in File system task

  • How to get the filename with this expression ?

    (DT_STR,4,1252)(DATEPART("yyyy",GETDATE())) +(LEN((DT_STR,2,1252)(DATEPART("MM",GETDATE()))) == 2 ? (DT_STR,2,1252)(DATEPART("MM",GETDATE())) : "0" + (DT_STR,2,1252)(DATEPART("MM",GETDATE()))) + (LEN((DT_STR,2,1252)(DATEPART("dd",GETDATE()))) == 2 ? (DT_STR,2,1252)(DATEPART("dd",GETDATE())) : "0" + (DT_STR,2,1252)(DATEPART("dd",GETDATE()))) +"_"+ REPLACE((SUBSTRING((dt_wstr,30) GETDATE() ,12,8)),":","") + "_"+ @[User::ATMTW_File_Name]

    This only returns 20110330_012059 without the filename.

    Thanks,

    PB

  • Where do you see the value 20110330_012059? During runtime or designtime? Is the variable that contains the filename populated?

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

  • This expression is in the File system task to move the file from one directory to another with yyyymmddhhmmss_Filename format . But I am only getting this yyyymmddhhmmss_ .

  • PSB (3/31/2011)


    But I am only getting this yyyymmddhhmmss_ .

    I repeat my question: when do you see this value? During runtime or during designtime?

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

  • Hi,

    I'm able to generate the file name using the given expression.Make sure that the varaible @[User::ATMTW_File_Name] is having some default value in it (Check in the variables windows).

    Thanks

    sam

Viewing 5 posts - 1 through 4 (of 4 total)

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