Sample string: 'DotNetMirror,'
Now we will remove , from the string.
Get Last Char in string:
Declare @STRING varchar(100)
set @STRING='DotNetMirror,'
select RIGHT(@String, 1)
Remove the last char(comma) in string :
IF(LEN(@String)> 0 AND RIGHT(@String, 1) = ',')
BEGIN
select substring(@String, 1, (len(@String) - 1)) --or
SET @String = LEFT(@String, LEN(@String) - 1)
END
select @String