How do I remove the last character in a string in T-SQL?
T-SQL
For example:
\'TEST STRING\'
to return:
\'TES
you can create function
CREATE FUNCTION [dbo].[TRUNCRIGHT] (@string NVARCHAR(max), @len int = 1) RETURNS NVARCHAR(max) AS BEGIN IF LEN(@string)<@len RETURN '' RETURN LEFT(@string, LEN(@string) - @len) END