• I would dump the expression and use Execute SQL Task as it is easier to read and maintain.

    Here is what I would do, you might need to tweak as I took 10 minutes just to put this together:

    /* comment out declares and set in sql task

    set-up ado.net connection

    pass in variables that are declared here

    Set-up result set to single row

    For result set, set result name to 0, use user variable FileLoadNumber as variable name

    DECLARE @BatchID INT

    DECLARE @FileLoadNumber int

    DECLARE @BatchDateISO datetime

    SET @BatchID = 11

    SET @BatchDateISO = GETDATE()

    SET @FileLoadNumber = '9'

    */

    Select CAST(@BatchID AS VARCHAR(20))

    + 'FHAS400'

    + CASE WHEN LEN(@FileLoadNumber) = 0 then '0' + convert(char(8),@BatchDateISO,112)

    ELSE CAST(@FileLoadNumber AS VARCHAR(10)) + convert(char(8),@BatchDateISO,112) end