Hi All.
This might be the wrong group to post this query, since it is ADO.NET
related, but I couldn't find any ADO.NET group.
My problem is that I want to write some queries, which use temp table
because of their complexity. My final results are in the temp tables.
How can I return a single result set from these multiple queries?
Regards,
--Jaffar
Barney Rubble - 05 Nov 2007 08:35 GMT
Just do a select. The ADO.NET library will populate a DataSet
DataTables with one table for each SELECT statement. Just make those
select statements come from the temp tables.
Not sure that selecting from temp tables would be good practice though
- they're (re)created in the temp database every time. Is there no
way you can either populate a "live" scratch table, or maybe even
break your logic down into more simple joins on existing tables? I'm
guessing you're using cursors to generate the results?
On Nov 5, 7:25 am, jaffar.k...@gmail.com wrote:
> Hi All.
> This might be the wrong group to post this query, since it is ADO.NET
[quoted text clipped - 7 lines]
> Regards,
> --Jaffar
Anthony Jones - 06 Nov 2007 11:39 GMT
> Hi All.
> This might be the wrong group to post this query, since it is ADO.NET
[quoted text clipped - 4 lines]
>
> How can I return a single result set from these multiple queries?
It would help if you specified the DB you are using. Its easy for use to
draw a whole bunch of assumptions from what you posted which may be wildly
inaccurate. Its not east to tell your level of skill with SQL.
For example by temp table do you mean a) Tables you've created in the DB to
temporarily receive results, b) #temp SQL server tables, c) DECLARE @Temp
TABLE ... SQL Server Table types OR d) somethine else altogether?
It may be that all you need is to understand how to use JOINS and UNIONS in
SQL better.

Signature
Anthony Jones - MVP ASP/ASP.NET