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 2000 Forums
 SQL Server Administration (2000)
 remove white space

Author  Topic 

Ex
Posting Yak Master

166 Posts

Posted - 2005-05-04 : 01:31:24
hey all i have just changed some cols from char(10) to varchar(10) and now i want to remove the trailing white space from the fields.

Is there a quick way to do this in query analyser or enterprize manager??

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-05-04 : 01:48:52
use rtrim but converting to varchar will automatically remove the trailing spaces

--------------------
keeping it simple...
Go to Top of Page

Ex
Posting Yak Master

166 Posts

Posted - 2005-05-04 : 02:20:34
maybe i did it wrong but i though it would too but it doesn't i did it in enterprise manager and design table view
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2005-05-04 : 04:17:46
Run this in query analyzer

UPDATE yourtable SET yourcolumn = rtrim(yourcolumn)

If that doesn't work, then it could be charcaters other than true white space.

-------
Moo. :)
Go to Top of Page

Ex
Posting Yak Master

166 Posts

Posted - 2005-05-04 : 20:00:56
yup thats what i ended up doing :) it all works fine just didn't know if there wouldl be a nice little function in enterprise manager :) always try to make life easy

ta
------------------------------------------------------------------
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Rich Cook
Go to Top of Page
   

- Advertisement -