data clean up question

  • I have imported from database a "char" field and upon entry i changed the field type to "varchar". For both fields the size was 15. However in char it fills the remaining spaces with spaces and in varchar it does not, but since I have imported the records from char to varchar the records have kept their extra spaces. My data in each each ranges from 4-8 characters and after each entry there are 7-12 spaces. This is keeping me from joining that field to another outside SQL. What can i do to erase the extra spaces... there are over 8000 records? I'm not going through each one. . .

  • on insert, or issue a separate update statement,

    use rtrim()

    it will remove trailing spaces from the value

     

    update mytable

    set mycol = rtrim(mycol)

  • thanks

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply