• Luis Cazares (6/20/2016)


    HappyGeek (6/20/2016)


    EdVassie (5/27/2016)


    export it to Excel and do a simple find and replace

    What is wrong with

    UPDATE yourtable

    SET Postcode = Replace(Postcode, ' ', ' ')

    FROM yourtable

    WHERE postcode LIKE N'___ ___ ';

    No need to export or re-import...

    Or even, to deal with trailing spaces;

    UPDATE dbo.Postcode

    SET p_code = RTRIM(REPLACE(p_code,' ', ' '))

    FROM dbo.PostCode

    That won't do any good. The column is an nchar, so the trailing spaces will be added.

    Correct, never spotted that, lesson learned, read the definition!!!

    ...