putting a value in for null

  • i have rows in a field that are causing me a problem and I think its because its set to numeric and some of the rows are blank.

    would this put a value into the field for me if im using a derived box

    ISNULL([Fixed Rate]) ? "0.00" : [Fixed Rate]

    it just doesn't seem to put the 0.00 into the field

  • What data type is Fixed Rate?

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

  • its coming from text file so its a string

  • ronan.healy (8/6/2014)


    its coming from text file so its a string

    Any errors when running the package?

    How do you verify if the NULL values have been replaced?

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

  • ya was getting errors and I used a datagrid view to look at the data but this fixed my problem

    ISNULL([Fixed Rate]) || [Fixed Rate] == "" ? "0.00" : [Fixed Rate]

  • ronan.healy (8/6/2014)


    ya was getting errors and I used a datagrid view to look at the data but this fixed my problem

    ISNULL([Fixed Rate]) || [Fixed Rate] == "" ? "0.00" : [Fixed Rate]

    Ah yes. If a field is empty in the source, SSIS will by default make it an empty string, not NULL.

    You can change this behaviour in the Flat File source by checking the checkbox for "Retain null values from the source as null values in the data flow".

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

  • o ya forgot I could do it there

    thanks for that

Viewing 7 posts - 1 through 6 (of 6 total)

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