[Solved] SQL query to get the multiple “,” positions from a string

Please try this one it will give output as yours. Create table #Table (rowNo int identity(1,1), ID varchar(100)) insert into #Table values(‘32132’) insert into #Table values(‘32132,32132’) insert into #Table values(‘32132,32132,6456,654,645’) declare @TableRow int = (select count(*) from #Table),@Tableloop int = 1 while(@Tableloop <= @TableRow) begin Declare @var varchar(100) ; SET @var = (select ID from … Read more