Trim all database fields

后端 未结 9 1978
孤城傲影
孤城傲影 2020-12-29 15:05

Do you know if there\'s a quick way in sql server (via transact-sql) that I could trim all the database string fields.

9条回答
  •  情书的邮戳
    2020-12-29 15:10

    Your question is a bit vague but is this what you are after?

    UPDATE mytable SET mycolumn= LTRIM(RTRIM(mycolumn))
    

    That will remove both leading and trailing spaces from all values in the 'mycolumn' column in the 'mytable' table.

提交回复
热议问题