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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to remove white spaces between words

Author  Topic 

cnaypi
Starting Member

22 Posts

Posted - 2008-05-30 : 15:37:49
What is the Select statement to remove white spaces between words?

Sep410
Posting Yak Master

117 Posts

Posted - 2008-05-30 : 15:56:02
Yo mean this?

select replace ('Test String',' ','')
Go to Top of Page

cnaypi
Starting Member

22 Posts

Posted - 2008-05-30 : 16:14:05
Thanks Sep410. It looks like the statement you provided removes the white spaces for the words that I indicate in the statement. Is there a way to do it so that it cleans up all the white spaces for all rows that are in one column.
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2008-05-30 : 16:30:28
Update MyTable
set Mycolumn = replace(MyColumn, ' ', '')

=======================================
We should try to be the parents of our future rather than the offspring of our past. -Miguel de Unamuno
Go to Top of Page

cnaypi
Starting Member

22 Posts

Posted - 2008-05-30 : 19:43:29
Thanks Bustaz it worked.
Go to Top of Page
   

- Advertisement -