Reputation: 2099
I am working in SQL Server 2008. I have a table with many columns that will not have values (at least, for the given situation). So, they will have a NULL value when I query each of them. I would like to instead make these NULL values be empty strings (i.e., ''). What is the best way to achieve this? My current idea is to set a DEFAULT value of '' on each them at the time that the table is created. However, since there are so many of them, this will be very tedious.
Upvotes: 0
Views: 59
Reputation: 2632
Upvotes: 0
Reputation: 1189
You have 2 options:
IsNull(ColumnName,'')
which means if ColumnName
is null
it'll return empty string ('').Upvotes: 1