microsoft:microsoft_sql_server:sql:find:find_leading_or_trailing_spaces
Table of Contents
Microsoft - Microsoft SQL Server - SQL - Find - Find Leading or Trailing Spaces
Find Leading and Trailing spaces
SELECT * FROM #Temp WHERE name LIKE '% ' --Will provide us values with Trailing space/s OR name LIKE ' %' --Will provide us values with leading Space/s
Update the records and remove leading and trailing spaces
UPDATE #Temp SET Name=LTRIM(RTRIM(Name)) WHERE name LIKE '% ' OR name LIKE ' %'
microsoft/microsoft_sql_server/sql/find/find_leading_or_trailing_spaces.txt · Last modified: 2021/08/05 13:38 by peter