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 #Temp SET Name=LTRIM(RTRIM(Name)) WHERE name LIKE '% ' OR name LIKE ' %'