SyntaxFix
Write A Post
Hire A Developer
Questions
I understand this question is for sql server 2012, but if the same scenario for SQL Server 2017 or SQL Azure you can use Trim directly as below:
Trim
UPDATE *tablename* SET *columnname* = trim(*columnname*);