I have a column that can have either NULL or empty space (i.e. \'\') values. I would like to replace both of those values with a valid value like
For an example data in your table such as combinations of
'', null and as well as actual value than if you want to only actual value and replace to '' and null value by # symbol than execute this query
SELECT Column_Name = (CASE WHEN (Column_Name IS NULL OR Column_Name = '') THEN '#' ELSE Column_Name END) FROM Table_Name
and another way you can use it but this is little bit lengthy and instead of this you can also use IsNull function but here only i am mentioning IIF function
SELECT IIF(Column_Name IS NULL, '#', Column_Name) FROM Table_Name
SELECT IIF(Column_Name = '', '#', Column_Name) FROM Table_Name
-- and syntax of this query
SELECT IIF(Column_Name IS NULL, 'True Value', 'False Value') FROM Table_Name