#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    2
    Rep Power
    0

    Importing null values


    I'm importing data from a flat text file to an MS SQL database using VB6 ADO.

    I have some fields that are empty. When I read them into a text string, they become empty strings, but I want them to show up in the db as <NULL> values. Is there a way to import the value as a null?

    Thanks!

    Doug
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    21
    Rep Power
    0
    not sure how you could fix it on the import but you could always run a script to change blanks to nulls

    update user_table
    set column = null
    where datalength(column) = 0

IMN logo majestic logo threadwatch logo seochat tools logo