How To Replace Nulls With Blanks In SQL Server

UPDATE
	table
SET
	field = ''
WHERE
	ISNULL(field, 'dummyvalue') = 'dummyvalue'

ISNULL checks if “field” is null and if it is null it returns 'dummyvalue', if that's equal to 'dummyvalue' then it sets the field to '' (which is NOT the same as null in SQL Server).

howto/replace_nulls_with_blanks_in_sql_server.txt · Last modified: 2011/12/19 21:33 by smark
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0