SQL Server: Script to Remove Trailing Character from Number Column

In this post, I am providing one TSQL script to remove the trailing characters from Number in SQL Server.

Before a few days ago, I did a data migration from old CSV files to SQL Server table and found that one of our value has some trailing characters like, km, kg.
Actually, this trailing character required to remove from that number column, so I have prepared one TSQL script to perform this task.

First, Create sample table and data:

Select your number with any trailing characters:

The Result:

SQL Server Remove Trail Character

Script to remove trailing characters from Number column:

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of