NULL value in column using bcp

  • I am using bcp to insert data into a table. For just one column, i am getting NULL values as character 'NULL'. How can we deal with it ? I was checking in MS site and it gives one -k option which specifies that "empty columns should retain a null value during the operation, rather than have any default values for the columns inserted".

    However I'm looking for a solution where the NULL should be treated as NULL value and not 'NULL' string for just one column. Can anyone suggest what to do ?

  • I'll try using blank value rather than NULL in txt file.

  • A NULL value in a CSV file is two delimiters with nothing between them. You're not using the actual word 'NULL' in your file are you? Also, do you have a trigger that might be converting a real NULL to the word 'NULL' in that one column?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 1 through 2 (of 2 total)

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