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 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-03-08 : 04:33:16
|
| i have select @mystring='xxx'+ '&work_phone_ext=' + cast(work_phone_ext as varchar) from customers where id=45now if work_phone_ext is null then it makes the whole mystring null -- how can i make it just return a blank if it is null? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-08 : 04:41:06
|
| select @mystring = 'xxx' + '&work_phone_ext=' + isnull(cast(work_phone_ext as varchar), '')from customerswhere id=45Peter LarssonHelsingborg, Sweden |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2007-03-08 : 15:33:54
|
| select @mystring=coalesce('xxx'+ '&work_phone_ext=' + cast(work_phone_ext as varchar),'') from customers where id=45--------------------keeping it simple... |
 |
|
|
|
|
|