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
 General SQL Server Forums
 New to SQL Server Programming
 How to Delete all spaces...

Author  Topic 

Rheinhardt
Yak Posting Veteran

66 Posts

Posted - 2009-05-28 : 08:17:34
Hi,

I have a column with Names wich I copied from an excell sheet but in doing that all the names has trailing spaces:

Columna
Sally Mia_____
Peter Smith__

How do delete all the trailing spaces without deleting the spaces within the name and surname?

Thanks

Dev@nlkss

134 Posts

Posted - 2009-05-28 : 08:19:34
Use RTRIM()

$atya.

Love All Serve All.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-05-28 : 08:21:31
update table
set column = rtrim(column)


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Rheinhardt
Yak Posting Veteran

66 Posts

Posted - 2009-05-28 : 08:25:40
Thanks
Go to Top of Page

Prasanthp2006
Starting Member

1 Post

Posted - 2009-05-28 : 13:33:24
update [Tablename] set fieldname=replace(fieldname,' ','')


Regards,
Prasanth P
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-28 : 13:43:40
quote:
Originally posted by Prasanthp2006

update [Tablename] set fieldname=replace(fieldname,' ','')


Regards,
Prasanth P


this will even remove in between spaces which is not what OP wants
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-05-29 : 02:12:48
quote:
Originally posted by Prasanthp2006

update [Tablename] set fieldname=replace(fieldname,' ','')


Regards,
Prasanth P


Read the question again

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -