quote:
Works like a charm, thanks!
Thanks! This is my first time making suggestions on this site. I always come here for questions instead 🙂 Here's a loop to remove multiple spaces...
-------------------------------------------
declare @strName varchar(100)
select @strName = ' S t J a m e s '
while charindex(' ',@strName) > 0
begin
select @strName = ltrim(@strName)
select @strName = rtrim(@strName)
select @strName = left(@strName,(charindex(' ',@strName)-1))+right(@strName,(len(@strName)-charindex(' ',@strName)))
end
select @strName
-------------------------------------------
Edited by - fubak on 08/20/2003 1:13:54 PM