I have a stored procedure which accepts a string of unique numbers separated by commas
Ex: 1,2,3,4,5,6,7,8,9,10
Now i want to find a number say
4 and remove it from the list.
New list should look like
1,2,3,5,6,7,8,9,10
I did it using the below method
DECLARE @str varchar(100);
SET @str=','+ '1,2,3,4,5,6,7,8,9,10,11,12';
SELECT STUFF(REPLACE(@str,',12,',''), 1, 1, '');
I am checking to do it in a better way.
Does any one have a better idea.Please feel free to reply :).