Friday 4 May 2018

Remove Last Character from a String in SQL Server

Remove the last character in a string in T-SQL?
Description:

In this example we explain that how to remove last character from string in SQL Server. Or how to truncate or remove Last character from string in SQL Server. Or SQL Query to remove last character from string using SQL Server. There are many ways to remove last character from string in SQL Server we have used one of the below query that will helpful to all users.
Query:

Declare @str varchar(50)
set @str='removelastcharacter,'

Select reverse(stuff(reverse(@str), 1, 1, '')) As Ids


Output will be below

removelastcharacter


This entry was posted in :

0 comments:

Post a Comment