If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Database Server Software > Microsoft SQL Server > How to display blank?

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Mar 2003
Posts: 223
How to display blank?

Hello, everyone:

By default, SQL Server display "NULL" if there is no data value. How to display blank instead of "NULL"? Thanks a lot.

Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Nov 2003
Posts: 94
Assuming the [value] to be a character type:


You may have to cast non-chars to be chars. 'Blank' can never be a valid numeric but


may hit the spot.
Reply With Quote
  #3 (permalink)  
Just DBA
Join Date: Jul 2002
Location: Village, MD
Posts: 621
Returns the first nonnull expression among its arguments.

COALESCE ( expression [ ,...n ] )
Reply With Quote
  #4 (permalink)  
World Class Flame Warrior
Join Date: Jun 2003
Location: Ohio
Posts: 12,561
Simple solutions, but this is a formatting issue that is best left to your interface to handle. Both of these solutions display correctly by changing the actual value returned from a NULL to an empty string. NULLs and zero-length strings are very different data values, and may be interpreted differently by whatever reporting interface is receiving the result set.
If it's not practically useful, then it's practically useless.

www.chess.com: "sqlblindman"
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On