IN SQLite I wrote :
UPDATE MYTABLE SET MYFIELD = TRIM(MYFIELD);
What to do to have this on SQL Server 2014 ?
Advertisement
Answer
UPDATE MYTABLE SET MYFIELD = LTRIM(RTRIM(MYFIELD));
However, field type must be varchar() and not text. Otherwise you get “Argument data type text is invalid for argument 1 of rtrim function”