Home / Software / Tips and Tricks / How to convert the last character in a SQL server Column to ASCII value?

How to convert the last character in a SQL server Column to ASCII value?

Updated:  08/12/2012 05:08 AM
Author:  Shiju Mathews

Status:    Resolved.


When we are dealing with data cleanup in SQL server table, one of the disturbing situations is to identify the special characters in the beginning or the end of the string (column) for removal. The following query gives the ASCII Value of the last character. This will help you to identify the unwanted character at the end of the string.



Once the unwanted special character is identified you can user use the REPLACE Method to clean up the data



where '32' is the decimal value for space(' ')