I've tried
update Table_Name set Name=Trim(Name)
But its not working..the string in which i want to remove leading and trailing spaces is as follows:
' % of critical assets, that should be monitored via PdM technologies, are being monitored '
which is currently in the column named as Name from my table
If the datatype is CHAR or NCHAR, you cannot remove trailing spaces. You can only do that on VARCHAR/NVARCHAR
Try using
update Table_Name set Name=LTRIM(RTRIM(Name))
instead of TRIM
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.