sql server remove spaces code example
Example 1: sql remove spaces
SELECT TRIM(' Exemple ');
SELECT LTRIM(' Exemple ');
SELECT RTRIM(' Exemple ');
SELECT TRIM(BOTH 'x' FROM 'xxxExemplexxx');
SELECT TRIM(LEADING 'x' FROM 'xxxExemplexxx');
SELECT LTRIM('xxxExemplexxx', 'x');
SELECT TRIM(TRAILING 'x' FROM 'xxxExemplexxx');
SELECT RTRIM('xxxExemple', 'x');
Example 2: sql update table remove spaces
LTRIM(RTRIM(ColumnName))
Example 3: remove spaces sql 2008
SELECT RTRIM(LTRIM(' Word '))
Example 4: remove all spaces from string sql
SELECT REPLACE(' Hello World ',' ')