SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Australia
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Removing Between White Spaces in MS SQL

    How would i go about removing in between spaces from a string?

    If i have "HI MY NAME IS AARON" and want to make that "HIMYNAMEISAARON" how can this be done in MS SQL?

    I know about LTRIM and RTRIM but i dont know of anything betweeen...

    Any help?
    Cheers

  2. #2
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look up the "REPLACE" SQL function in the SQL Server books.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Australia
    Posts
    122
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanks for that it works a wonder

    REPLACE(' This is my string', ' ', '')

    = 'Thisismystring'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •