I have trailing spaces in a column in a SQL Server table called Company Name.
All data in this column has trailing spaces.
I want to remove all those, and I want to have the data without any trailing spaces.
The company name is like "Amit Tech Corp "
I want the company name to be "Amit Tech Corp"
Try
SELECT LTRIM(RTRIM('Amit Tech Corp '))LTRIM– removes any leading spaces from left side of stringRTRIM– removes any spaces from rightIn SQL Server 2017 or later:
TRIM– removes any spaces from left and rightEx: