Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
varalakshmi
Yak Posting Veteran
98 Posts |
Posted - 2008-05-07 : 08:17:04
|
Hi,I need to display a default value in the query result if the column has null values . Say for a string column if it is NULL then I would display something like 'NO DATA' .Can anyone of you suggest how I can go about this? |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-07 : 08:24:22
|
[code]select iif(col is null, 'NO DATA', col) as colfrom table[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
varalakshmi
Yak Posting Veteran
98 Posts |
Posted - 2008-05-08 : 09:00:06
|
Thank you... |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-05-08 : 09:09:21
|
Also you may get error if col is of INT datatypeBetter do this when you show data at front endMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|