Remove extra comma at the end in Sql Server.

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 414
This can be done with the help of Substring in-built method ,it takes 3 arguments as:-
Syntax:-
Substring(string_expression,start_position,string_length);


For Example:-
Declare @strvar as Varchar(1000) = 'Vishal,Kumar,0123456789,';
Select Substring(@strvar,1,len(@strvar)-1) as 'Remove_Last_characters'


Output:-
Vishal,Kumar,0123456789

Comments or Responses

Login to post response