Running Multiple Queries

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

Greetings,

I'm developing an ASP.NET site and need a couple of queries to create
various content. As it stands, I'm running each query separately, reading
the result into a SqlDataReader.

It occurs to me that one thing that consumes a fair amount of time is the
round trip to the database server. Could I benefit by sending multiple
queries at the same time, separated by a semicolon? Is this much faster? How
can I retrieve multiple resultsets this way?

Note: This particular data is handled manually--I'm not sending it to any
databound server controls.

Thanks.

Jonathan
 
It really isn't - nanoseconds, maybe...

If anyone could shed some light on this, I'd be very interested.

As far as I'm concerned, when the database is on a separate server, the
request itself would take more than nanoseconds.

Jonathan
 
I didn't say that the request itself would take only a few nanoseconds - I
said that the difference between the two methods would be a matter of
nanoseconds...

The question I asked related to the difference between sending two queries
as separate database requests vs. combining them into a single request. If
you send them as two separate requests, then the time associated with the
request would be included in the difference between the two. Therefore, if
the total difference was a few nanoseconds, that would require that the
request portion of the time would be equal to or less than a few
nanoseconds.

Jonathan
 
Ok......... sorry, I must have "mis-remembered" (in my Roger Clemens voice).

Nobody lies or bears false testimony anymore, they just "mis-remember" it !!

Stunningly, they usually only remember mis-remembering it when they are
caught in a lie.
 
Back
Top