I have string in format:
8:live:avishekh.bh 8:prakash.tndk 8:niraj.bajra
I want these in the format :
[live:avishekh.bh, prakash.tndk, niraj.bajra]
How could I achieve that in SQLServer?
You can use combination of stuff and replace:DEMO HERE
declare @string varchar(100)='8:live:avishekh.bh 8:prakash.tndk 8:niraj.bajra'
select
'['+
stuff(
replace(@string,'8:',','),1,1,'')+']'