Optimising Database Calls



I have an ASP page that makes a vml/svg graph out of data. In order to
extract all the necessary data I have to perform 68 SQL queries, which is
unfortunatley a bit slow at the moment.

For each of the procedures I go through code of this form

Dim conn As New SqlClient.SqlConnection("Data Source=" & ServerName & ";
User ID=***; Password=***")
conn.Open()
SQL = "" 'in operation has code to dynamically construct one of the
queries.
Dim command As New SqlClient.SqlCommand(SQL, conn)
Dim r As SqlClient.SqlDataReader
r = command.ExecuteReader
While r.Read
'Code here to extract data and plot one section of the graph
End While
r.Close()
conn.Close()

Is there anything I am doing here that would make the code slower. For
instance, can I share one connection, and with this speed things up? Is
there a way to keep the same command object and keep changing the SQL? would
this be any faster? Any other ideas on how to speed this up?

Thanks,
Martin


.



Relevant Pages

  • Re: Missing Daigrams
    ... post named "VB6 SP6 problem with SQL 2000 Enterprise ... Manager" in the newsgroup microsoft.public.vb.bugs. ... (You might need winzip to extract files/cabs) ...
    (microsoft.public.sqlserver.tools)
  • Re: Epicor - Vantage product
    ... PICK system...do you know anything about this...I am trying to extract the data into SQL so we can qry the old records. ... Depending on the release of UV that you're running, you should have a perfectly good SQL engine available in UV. ... consulting help can be provided to get the data flattened and extracted. ... Systems Theory internet music project links: soundclick garageband "Soundtracks For Imaginary Movies" CD released Dec 2004 "Codetalkers" CD coming end of 2005 NP: nothing. ...
    (comp.databases.pick)
  • Re: Sql Server 2005 Setup will not run
    ... I got the setup program from my MSDN subscription and extracted the ISO ... contents to a local directory. ... Did you extract both CD1 and CD2? ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.tools)
  • Re: Wildcards in Calculations
    ... now I have all this SQL ... crap floating around in my head, and I need to make a new FMP layout ... I need to extract the number from the left up to the space or the x. ... running around in circles in my head... ...
    (comp.databases.filemaker)
  • Re: Searching/Estracting numerical data
    ... Extract Number from Fields - SQL ... The function you would use to find where a three digit sequence in ... varchar data is located is ...
    (comp.databases.ms-sqlserver)