Решение:
http://stackoverflow.com/questions/3608916/solving-a-problem-with-cursors DECLARE MyCursor1 CURSOR FOR SELECT Value FROM [dbo].[split] ('1;2;3;4;',';') open MyCursor1 declare @attrID int, @values nvarchar(256) select @@FETCH_STATUs WHILE (1=1) BEGIN FETCH next from MyCursor1 INTO @attrID select * from Class293 inner join Class339 on Class339.p3237=Class293.p2175 where p2193=12 and P3239=@attrID and Class293.ObjectID in ( SELECT Value FROM [dbo].[split] ('80;74;75;72;79;78',';') ) IF @@FETCH_STATUS <> 0 BREAK END CLOSE MyCursor1 DEALLOCATE MyCursor1