Working on SQL (2005 and 2008)
the variable with value '1,2,3' would be call @cedis and this could to have N number for example
set @cedis='1' or set @cedis='1,2,3,4,5,6,7' or set @cedis='125,98,91'
so important, its this must to be a select only, a loop could not to be use, only a select!
this must to return a (result as ) table with values for example
set @cedis='1,2,3,4' this must to return a result number 1 2 3 4 declare @cedis varchar(max) set @cedis='1,58,123,8' ;with datos as ( my select with is going to return me the table ) select * from datos
result set is
number
1
58
123
8