Newbie SQL question

  • How do I get rid of nulls in certain fields. In the old dbase, I could simply do a REPLACE. Is there an equivalent in SQL? Thanks for any help.

  • Check out the Books OnLine for ISNULL.

    ISNULL(check_expression, replacement_expression)

    Select ISNULL(mycolumn, 'NewEntry')

    -SQLBill

  • Or you could use IS NULL:

    UPDATE mytable

    SET mycolumn = 'newentry'

    WHERE mycolumn IS NULL

    -SQLBill

  • Ok, thanks. That worked fine.

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

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