+1  A: 

can you not define a view on the db server that does the union query for you, so from the client code it just looks like a single select?

if you can't, can you just issue the union operation as part of your select, e.g.

select some_fields from table1
union
select same_fields from table2

and treat the result as a single result set?

Steven A. Lowe
I was trying to avoid views because it would require a database update (And not all servers support them). If I was to so a db update, I may just require the DB to support a single table.
David L Morris
ok, edited response
Steven A. Lowe
and forward only scrolling would probably be more efficient if that is an option
Steven A. Lowe
I am allready doing that. Fetch positioning is not allowed on SQL forward only scrolling (at leasting SQL Server), which is the root cause of my problem.
David L Morris
[@David L Morris] but if all you're doing is filling a list, why do you need fetch positioning?
Steven A. Lowe
The list might be a million items long. Inly the items in view or near to being in view or at the very end of the list are cached locally.
David L Morris
A: 

if the issue is just needing to get the last row to get the number of rows and caching the last few rows [i assume if there are a million items in the select that you're not populating a drop-list with all of them ;-)] then you may be able to take advantage of the ROW_NUMBER() function of sql server 2005

you could select count(*) from (select blah UNION select blah) to get the number of rows, then select ROW_NUMBER() as rownum,blah from (select blah UNION select blah) where rownum between minrow and maxrow to just fetch the rows that you need to display/cache

but seriously folks, if you're selecting items from a million-row table, you might want to consider a different mechanism

good luck!

Steven A. Lowe
A: 

have you tried making the union a derived table?

select * from (select field1, field from table1 union all slect field1, filed2 from table2) a

HLGEM
Yes. That was the question. Select works Union of two selects does not.
David L Morris