Remove Trailing Spaces and Update in Columns in SQL Server -



Remove Trailing Spaces and Update in Columns in SQL Server -

i have trailing spaces in column in sql server table called company name.

all info in column has trailing spaces.

i want remove those, , want have info without trailing spaces.

the company name "amit tech corp "

i want company name "amit tech corp"

please help me in this.

--agmraja

try select ltrim(rtrim('amit tech corp '))

ltrim - removes leading spaces left side of string

rtrim - removes spaces right

ex:

update table set companyname = ltrim(rtrim(companyname))

sql sql-server-2008 trailing

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -