How to remove invisible characters in t-sql?

后端 未结 7 919
天命终不由人
天命终不由人 2021-02-02 09:07

I tried

UPDATE TABLENAME SET COLUMNNAME = REPLACE(COLUMNNAME, \'\\t\', \'\')

But I don\'t know how to write the TAB in t-sql

7条回答
  •  伪装坚强ぢ
    2021-02-02 09:44

    For TAB and ENTER

    SELECT
        -- TRIM AND REPLACE `TAB` AND `ENTER`
        LTRIM(RTRIM(
            REPLACE(
                REPLACE(
                    REPLACE(columnname, CHAR(9), ' '),
                CHAR(13), ' '),
            CHAR(10), ' ')
        ))
    

提交回复
热议问题