Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howto:replace_nulls_with_blanks_in_sql_server [2011/12/19 21:33] (current)
smark created
Line 1: Line 1:
 +====== How To Replace Nulls With Blanks In SQL Server ======
  
 +<​code>​
 +UPDATE
 + table
 +SET
 + field = ''​
 +WHERE
 + ISNULL(field,​ '​dummyvalue'​) = '​dummyvalue'​
 +</​code>​
 +
 +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