Fabio,
>Of course, the structure of the cursor is the same!
>It is the COMPLEX source that it is contidional.
Then there is no reason to not create table inside the SP and insert into it based on whatever complex condition you have.
Later Update Which would also help insure that all of the source SQLs would actually generate the same result structure thereby increasing the reliability of the SP.
>Of course i can write all the workarounds, but this is not the point,
>the point is the MS SQL bug.
I'm not sure I see it as a SQL bug. FWIW I doubt the SQL team reads the UT looking for your bug reports.