473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
Jul 21 '05 #1
2 2471
Perhaps QA has an open connection to the database already?

Greg

"vidya" <sa*********@hotmail.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
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

Jul 21 '05 #2
Just a guess, but try natively compiling the aplication first (ngen.exe).

"vidya" <sa*********@hotmail.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
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

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Gray | last post by:
Hello all, Having problems connecting to an Oracle 9i database from within SQL/Server 2000 using the Security/Linked Servers feature. Server1 (SQL/Server) ----------- Windows Server 2003,...
3
by: Dan Berlin | last post by:
I have two tables: T1 : Key as bigint, Data as char(20) - size: 61M records T2 : Key as bigint, Data as char(20) - size: 5M records T2 is the smaller, with 5 million records. They both have...
1
by: Russell Kahler | last post by:
I have two server defined (S1 and S2) S1 has a link defined to S2. If I open Query Analyzer and run a query referencing S2 server. My statement returns data (lets say I am using MSSQL standard...
2
by: Elvira Zeinalova | last post by:
Hei, We have 2 MS SQL SERVER 2000 installed on 2 different servers (2 separated machines). I am triing to connect them så that when one row is added to the table in the database in main server - ...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
2
by: vidya | last post by:
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...
5
by: Neil | last post by:
I am getting time-out errors when I try to perform a simple delete on a linked server. The command is: Delete From MyTable Where PKID=12345 I have tried executing this command directly from...
1
by: jeeji | last post by:
HI I am experiencing something funny here where I have two equivalent queries: If I run them through query analyzer, the first runs slower than the second, but if run through C# application, the...
7
by: alexbf | last post by:
Hello, I have a stored procedure in SQL Server 2000. When I execute it through my .NET application (OleDbCommand), I can see (in SQL Profiler) that it takes 423 ms to complete. If I run the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.