Re: Speed problem with mssql 2000 and ado

From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 03/27/04


Date: Fri, 26 Mar 2004 20:59:37 -0600


>SELECT FIELD1, FIELD2 FROM TABLE1 WHERE ID = :Id)
>
>FIELD1 = nvarchar(255)
>FIELD2 = ntext
>Id = integer
>
>which is executed one thousand times in a loop. The complete loop takes
>about 70 seconds!!!

Looping like that is a poor idea for an SQL server.
What are you doing with the query?

You can use the Execute method of AdoConnection to get a select query directly
to a recordset. That will save some overhead.

--
Brian Bushay (TeamB)
Bbushay@NMPLS.com


Relevant Pages

  • Re: Loop thru files and process each one
    ... > Looping, Importing and Archiving ... >> write a DTS Package to loop through the files and process each one. ... >> file name into the Stored Proc. ... >> package, but I do not know how to loop through each one, execute my stored ...
    (microsoft.public.sqlserver.dts)
  • Re: Loop thru files and process each one
    ... Looping, Importing and Archiving ... > write a DTS Package to loop through the files and process each one. ... > file name into the Stored Proc. ... > package, but I do not know how to loop through each one, execute my stored ...
    (microsoft.public.sqlserver.dts)
  • Re: Unfinished Loop
    ... different table cells. ... It appears to only execute the first instead of ... looping. ... How can I get it to loop through? ...
    (comp.lang.javascript)
  • Safe multithreading in ASP.Net
    ... Code in global.asx Application_start subroutine, ... Dim emails As New ForumEmail ... Do While ContinueNotify 'boolean value set to True so loop will continue ... the thread still continues to execute. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: What is the difference between for..if, case statements, do..while
    ... ElseIf Then ... It can not execute both This and That or any ... Loop Until ... How does one decide which programming construct to use. ...
    (microsoft.public.excel.programming)