> 1. Tried both client-side and server-side. No difference.
> 2. Tried that. No difference
> 3. Using SQL Profiler for timing.
> 4. Tried that also. No difference.
> 5. Command object didn't work either.
> > Couple of immediate observations....
> > 1. Why the server-side cursor? User client-side and stream it as fast
as
> > your network bandwidth allows.
> > 2. In the Open function of the Recordset, you need to specify the
Command
> > Type of adCmdStoredProc as the fourth parameter. If you don't specify,
it
> > will make a call to SQL Server trying to ascertain what type of command
it
> > might be.
> > 3. Are you timing the raw data retrieval or is your string
concatenation
> > while parsing the fields going into your timing?
> > 4. Might consider a disconnected recordset, get all the data back then
> parse
> > the rows at your leisure.
> > 5. Pre-binding to the stored procedure using a Command object may also
> yield
> > faster results.
> > Few quick ideas.....
> > HTH
> > --
> > Patrick Logan, MCSD
> > Opinions expressed are my own and not necessarily those of my employer.
> > > I'm using ADO 2.7, and here is one example (VB) that produces the
> results
> > I
> > > metioned before.
> > > Dim cn As New ADODB.Connection
> > > Dim rs As New ADODB.Recordset
> > > Dim SQL As String
> > > Dim sConnect As String
> > > Dim i As Integer
> > > Dim sOut As String
> > > Dim dTime As Double
> > > Me.MousePointer = vbHourglass
> > > dTime = Timer
> > > SQL = "exec sp_GetVirtualLines -1"
> > > cn.Open "Provider=SQLOLEDB.1;Initial Catalog=MyDB;Data
> > > Source=MyServer;Network Library=dbmssocn;", _
> > > "MyUser", _
> > > "*********"
> > > rs.CursorLocation = adUseServer
> > > rs.Open SQL, cn, adOpenForwardOnly, adLockReadOnly
> > > sOut = ""
> > > If Not (rs.EOF And rs.BOF) Then
> > > sOut = sOut & "<tr>" & vbCrLf
> > > For i = 0 To rs.Fields.Count - 1
> > > sOut = sOut & "<th>" & rs.Fields(i).Name & "</th>" &
> > vbCrLf
> > > Next
> > > sOut = sOut & "</tr>" & vbCrLf
> > > While Not rs.EOF
> > > sOut = sOut & "<tr>" & vbCrLf
> > > For i = 0 To rs.Fields.Count - 1
> > > sOut = sOut & "<td>" & rs.Fields(i) & "</td>" &
> vbCrLf
> > > Next
> > > sOut = sOut & "</tr>" & vbCrLf
> > > rs.MoveNext
> > > Wend
> > > End If
> > > rs.Close
> > > Set rs = Nothing
> > > cn.Close
> > > Set cn = Nothing
> > > > Post the code that executes the stored proc..... Version numbers of
> ADO
> > > and
> > > > Providers as well.
> > > > --
> > > > Patrick Logan, MCSD
> > > > Opinions expressed are my own and not necessarily those of my
> employer.
> > > > > When running certain stored procedures from an ADO client
> (VB,VBS,ASP
> > > > > (VBScript)) the execution time is 10 times as long as when running
> the
> > > > same
> > > > > procedure with the same arguments inside of Query Analyzer. Can
> anyone
> > > > > explain this to me?
> > > > > I am running W2K Server SP2, SQL Server 2000 SP2, dual 1.4GHz, 1
GB
> > RAM,
> > > > > SCSI RAID 5 HD Config.
> > > > > Thanks in advance,
> > > > > Sean