Re: When do selects execute for multiple resultsets



Sure. Somewhat simplified, SQL Server executes each query and stops when its
initial buffer is full (less than 10K). When your code asks for rows,
(DataReader.Read) the buffer is emptied and more rows are retrieved--as fast
as you can pull them over. As you fetch more rows with Read, more rows are
located based on the query's WHERE clause etc. When the first resultset is
complete, the server pauses again waiting for the DataReader.NextResult.
Once that returns True, the process is repeated until there are no more
resultsets.

The CommandTimeout is measured from the time you execute the query until the
time the first row is made available by SQL Server.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"mcerutti" <mcerutti@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8CD9FC2A-0268-42C3-95D1-28F078314224@xxxxxxxxxxxxxxxx
> Does anyone know how multiple resultset stored procedures are executed
> when
> using data readers? It appears that the sp is paused after each select
> until
> the client requests the next resultset.
>
> Also, does the command timeout apply to the intial query time or for the
> time it takes to start returning the final resultset?


.



Relevant Pages

  • RE: Tuning query?
    ... the memory of the SQL Server, so you are seeing the delay caused by the disk ... Once it's in memory, it executes that much fast as it doesn't need to refer ... In the query Steve has done, the function calculation is carried out once, ...
    (microsoft.public.sqlserver.programming)
  • Re: multiple times execution of procedure
    ... If Query ... Analyzer told you that then it might not be accurate because it can't give ... server or what happened with the network link between SQL server and the ... concurrently and it executes that in an iteration M times. ...
    (microsoft.public.sqlserver.programming)
  • Query returns -1 if row present (DBI, SQL Server 2000)
    ... I am using the DBI module to interface with a SQL Server 2000 database ... -- connection, INSERT, UPDATE, and SELECT (when 0 rows exist in ... resultset) are fine. ... The SELECT query also runs fine in Query ...
    (comp.lang.perl.misc)
  • Re: Query returns -1 if row present (DBI, SQL Server 2000)
    ... I am using the DBI module to interface with a SQL Server 2000 database ... resultset) are fine. ... The SELECT query also runs fine in Query ... "Returns the number of rows affected by the last row affecting command, ...
    (comp.lang.perl.misc)
  • Re: Recordset or Object is closed HELP PLEASE!
    ... Are you sure that in all instances of the SQL statement, ... actually have a resultset? ... > different query that is simpler. ... > SQL Server the query is giving me that error:'3704' ...
    (microsoft.public.excel.programming)