U can use this simple logic -
Declare@products varchar(200)='1|20|3|343|44|6|8765'Declare@individual varchar(20)=nullWHILE LEN(@products)>0BEGINIF PATINDEX('%|%',@products)>0BEGINSET@individual = SUBSTRING(@products,0, PATINDEX('%|%',@products))SELECT@individual
SET@products = SUBSTRING(@products, LEN(@individual +'|')+1,
LEN(@products))ENDELSEBEGINSET@individual =@products
SET@products =NULLSELECT@individual
ENDEND