473,569 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Execute NonQuery() 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 2485
Perhaps QA has an open connection to the database already?

Greg

"vidya" <sa*********@ho tmail.com> wrote in message
news:Om******** ******@tk2msftn gp13.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.Execute NonQuery() 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*********@ho tmail.com> wrote in message
news:Om******** ******@tk2msftn gp13.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.Execute NonQuery() 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
24269
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, Standard edition MS SQL/Server 2000 Oracle 9i Client kit (OLEDB & ODBC) & Enterprise management tools
3
10069
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 clustered indexes on Key. I want to do:
1
4186
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 authenitcation). Now I have a ASP.NET application that connects to S1 server using ODBC. The exact same statement returns an error. Driver]The...
2
11726
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 - then the same row is added to the same table in the second server database. I made the insert trigger on the table in the first server ( the second...
12
2763
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 both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new...
2
245
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 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...
5
9915
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 Query Analyzer, but it just times out. However, when I run it from QA against the server itself (rather than from my local server against a linked...
1
1745
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 first runs faster than the second. I have the following two equivalent versions of a query which I will present in psuedo code:
7
1828
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 same exact query in Query Analyzer, it takes 216 ms (in SQL Profiler).
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.