That's one way, Morten. Another, which is very dependent on the type of data you're passing through, could pass a delimited list (a big string) to the stored proc and use some of the following code: DECLARE @Array varchar(50) DECLARE @iStart int DECLARE @iEleFound int DECLARE @iMaxEleLen int DECLARE @iNextDelimIndex int DECLARE @iEleLen int SET @Array = '1,2,3,4,5,6,7,8,9,65,66,67,100,101,102,654321' SET @iStart = 0 SET @iEleFound = 0 SET @iMaxEleLen = 5 SET @iNextDelimIndex=0 SET @iEleLen =0 print '---------' print 'LENGTH of string: ' + CAST(LEN(@Array) AS VARCHAR) while CHARINDEX ( ',' , @Array,@iStart ) > 0 -- for each element in the array begin SET @iEleLen =1 --default --if not ',' or '' if (CAST(SUBSTRING(@Array, @iStart + 1, 1) AS char(1)) <> ',') and not(len (SUBSTRING (@Array, @iStart + 1, 1)) = 0) begin--element found at this index SET @iNextDelimIndex = CHARINDEX ( ',' , @Array,@iStart+1) if(@iNextDelimIndex=0) begin SET @iNextDelimIndex = CAST (LEN(@Array) AS VARCHAR)+1 print 'latest element is next:' end SET @iEleLen = @iNextDelimIndex - @iStart --DB function would occur here print 'NEXT DELIM LOCATION-->' + CAST(@iNextDelimIndex AS VARCHAR(10)) print 'VALUE FOUND-->' + RTRIM( CAST(SUBSTRING(@Array, @iStart + 1, @iNextDelimIndex - @iStart-1) AS char(10)) ) + '<--' SET @iEleFound = @iEleFound + 1 end else --no element found at this index begin print 'do nothing' end SET @iStart = @iStart + @iEleLen end --if (CAST(SUBSTRING(@Array, @iStart + 1, 1) AS char(1)) <> ',') and not(len (SUBSTRING (@Array, @iStart + 1, 1)) = 0) print '------ ELEMENTS FOUND: ' + CAST(@iEleFound AS CHAR(2)) + ' ---------' Note: not fully tested, but should give you a starting point. Cheers, Simon "Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)