SQL Server Query Analyzer faster than ADO.Net SQL Data Provider

  • Thread starter Thread starter vidya
  • Start date Start date
V

vidya

Hi,

I wrote a stored procdure in SQL Server which calculates some metrics.
This procedure always returns only one row with 11 columns of integer
values.

I ran it in SQL Server Query Analyzer thru a remote machine and it executes
the procedure in 5 to 6 seconds.
I wrote some ADO.Net SqlDataReader code and it takes 25 seconds to get the
data back from the same remote machine.
I tried SQLDataAdapter also and it takes 25 seconds.

I logged the time before the database call in the code and immediately after
the Command.ExecuteNonQuery() method.
I clearly see that it takes 25 seconds.

I also tried using Data Access Application block v2.0 from the microsoft
site. Even it takes 25 seconds.

I don't understand why Query Analyzer is so much faster than ADO.Net Sql
Data provider?
Can anyone explain this?

Thank You in advance
Vidya
 
Back
Top