Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / November 2007

Tip: Looking for answers? Try searching our database.

How to return single resultset with multiple database queries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jaffar.kazi@gmail.com - 05 Nov 2007 07:25 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.