====== 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 ' %'