Squeeze function

The Squeeze function is used to remove the multiple occurences of spaces into one occurence. In SQL Server there is no function to do the same. I needed to write this in my application to remove unwanted spaces in the string. Run the following and see the result declare @t table ( string_col varchar ( 100 )) insert into @t select 'a b' union all select 'a b' union all select 'a b' union all select 'a b' union all select 'a b' select string_col , replace ( replace ( replace ( string_col , ' ' , '...(<a href="http://sqlserver-qa.net/blogs/t-sql/archive/2007/12/06/2866.aspx">read more</a>)<img src="http://sqlserver-qa.net/aggbug.aspx?PostID=2866" width="1" height="1">