stored procedure help

  • Hello All,

    I have a table with two fields

    Vendor varchar(20)

    VendorResume text(16)

    I want to remove/reduce/replace multiple spaces with a single space in the VendorResume field. Does anyone have a store procedure handy for this.

    Thanks

  • this has been modified using a similar solution given in another post...

    DECLARE @text varchar(75)
    SET @text = 'this  is   multiple    spaces   reduced to        one'
    PRINT @text
    PRINT DATALENGTH(@text)
    WHILE 1 = 1
       BEGIN
           SET @text = REPLACE(@text, SPACE(2), SPACE(1))
           IF CHARINDEX(SPACE(2), @text) = 0 BREAK 
       END 
    PRINT DATALENGTH(@text)
    SELECT @text 
    







    **ASCII stupid question, get a stupid ANSI !!!**

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

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