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 |
veparala
Starting Member
30 Posts |
Posted - 2006-09-27 : 10:40:09
|
I would like to remove empty spaces in String variable. Can anybody help me? |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-27 : 10:45:51
|
Use REPLACE function:Select Replace('this has too many spaces', ' ', '') Harsh AthalyeIndia."Nothing is Impossible" |
|
|
veparala
Starting Member
30 Posts |
Posted - 2006-09-27 : 11:49:50
|
Thanks. It is working |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
sqlchiq
Posting Yak Master
133 Posts |
Posted - 2008-08-15 : 12:33:52
|
What about converting empty string to text?i have a column with empty entriesI tried...replace(column, '', 'notavail')but the empty entries are still empty |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-15 : 12:47:51
|
quote: Originally posted by sqlchiq What about converting empty string to text?i have a column with empty entriesI tried...replace(column, '', 'notavail')but the empty entries are still empty
by empty entries do you mean empty space? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-18 : 02:58:31
|
quote: Originally posted by sqlchiq What about converting empty string to text?i have a column with empty entriesI tried...replace(column, '', 'notavail')but the empty entries are still empty
SELECT CASE WHEN column='' THEN 'notavail' else column END from tableMadhivananFailing to plan is Planning to fail |
|
|
|
|
|