Hi all,DECLARE @CNT INTDECLARE @TOT INTSET @CNT = 0SET @TOT = (SELECT COUNT(*) FROM r_ord WHERE n_doc = 9)WHILE @CNT <= @TOT BEGIN SELECT Item,Desc FROM r_ord where Linea = @CNT AND doc_ref = 9 UNION ALL SELECT Item,Desc FROM r_off WHERE Line= @CNT and n_doc= 9 SET @CNT = @CNT + 1 END
I expected only 1 recordset ... but the returned more recordsetTablesTable1col1 col2 --------------- A 2 B 1 C 3
Table2col1 col2------------------A 3B 2C 4
The recordset that I expected it is thiscol1 col2A 2A 3B 1B 2C 3C 46 rows affected
But the query returns these recordsets ... col1 col2A 2A 32 rows affected
col1 col2B 1B 22 rows affected
col1 col2C 3C 42 rows affected
Where is my big wrong??thanks a lot...sorry for my english
See u--------------------------Sorry for my bad englishI Learn..I Learn..I Learn..