Removing white space from a column

  • I have a table with data that has white space between them.

    How do I remove the white space from the columns? I need to make it one number.

    I am in a SQL 2005 and dot net environment.

    Here is a sample of the data from one column:

    481393 20902 01002904339

  • Try this

    UPDATE TableName SET ColumnName = REPLACE(ColumnName, ' ', '')

    .

  • This should work.

    update TableName set Column = replace(Column, ' ', '')

    Hope that helps

    Fraggle.

  • Always love when I post and while I am writing someone else post the same thing. LOL.

    Fraggle

  • Type faster! =)

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • Thanks for your help. It worked

  • It wasn't the typing that was the issue. It was the phone call I took while replying that caused the performance issues. 😀

    Fraggle

Viewing 7 posts - 1 through 6 (of 6 total)

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