Hi Angel,
Thank you for the information.
It makes the problem even more mysterious.
First, I don't get any exception
(at least SQL Profiler neither show any exception from QA nor from .NET
Client).
The result sets returned by Query Analyzer and .NET SQL Client are
absolutely equal and correct.
Now it looks like this:
-QA - 3 sec, .NET Client - 30 sec
-SET ARITHABORT ON for the .NET SQL Client
-Still have .NET Client - 30 sec
but
-after I even once executed my stored proc in QA after setting ARITHABORT ON
for the .NET SQL Client
.NET Client execution time becomes 3 sec too!
So, with arithabort ON, .NET Client executes for 30 sec only if QA did not
call the stored proc at all.
If QA called stored proc at least once
then .NET SQL Client execution time becomes also 3 sec.
It looks like QA forces the SQL Server to recompile the stored proc in a
more efficient way.
So, arithabort on helps only if I have a chance to use QA to call the stored
proc before
actually calling it using .NET client...
Thanks,
Oleg
"angelsbadillos[ms]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> This is a topic that keeps repeating and I really would like to get to
> the bottom of it. The problem I have had trying to understand this
> behavior is that I _don't_ have a query that has a dramatic performance
> difference _and_ does what it is intended to do in query analizer.
>
> The last time I investigated this issue I was told that query analizer
> was optimized for reading operations and would sacrifice correctnes for
> performance. Not buying too much into this I looked at the SET
> properties and could only find one difference, SET ARITHABORT is on in
> one and off in the other (QA / SqlClient, sorry don't remember which is
> which).
>
> I guess what I want to ask is 1) is it possible to share a query/table
> schema that repros this problem in a standalone way?
> 2)Probably more realistic, can you try setting artihabort on and off to
> see if the problem is that your query throws an exception and QA just
> returns inmediately while SqlClient tries to do the right thing?
>
> Thanks,
> Angel
>
>
> Oleg wrote:
>> Hi Bill,
>> >>has to do with rowset population issues.
>> For me it has not to do with rowset population issues.
>> because this is execution time difference reported by SQL Profiler.
>> I did not measure it on the client machine.
>>
>> Oleg
>>
>> "William (Bill) Vaughn" <(E-Mail Removed)> wrote in
> message
>> news:%(E-Mail Removed)...
>> > We often see performance differences between OSQL/ISQL/SQLCMD and
> ADO. I
>> > expect it has to do with rowset population issues.
>> >
>> > --
>> > ____________________________________
>> > William (Bill) Vaughn
>> > Author, Mentor, Consultant
>> > Microsoft MVP
>> > www.betav.com
>> > Please reply only to the newsgroup so that others can benefit.
>> > This posting is provided "AS IS" with no warranties, and confers no
>
>> > rights.
>> > __________________________________
>> >
>> > "Oleg" <(E-Mail Removed)> wrote in message
>> > news:%(E-Mail Removed)...
>> >> Hi,
>> >>
>> >> I have the stored procedure which uses temporary tables
>> >> and does some calculations.
>> >> It executes in 3 sec when I use Query Analyzer.
>> >> When I execute it using ADO.NET client it takes 30 sec.
>> >> I looked at execution time using Profiler so this is not some the
> .NET
>> >> Framework bottleneck.
>> >> SQL server executed the same stored procedure ten times slower.
>> >> I use SQL 2000 SP2.
>> >> Another interesting thing that I've found:
>> >> When I changed the stored procedure to use table variables
> (@tablename)
>> >> instead of temporary (#) tables, Query Analyzer execution time
> becomes
>> >> one minute(!!!)
>> >> and ADO.NET execution time remains the same (30 sec).
>> >>
>> >> Does anyone know how to solve the problem, because my application
> is
>> >> written in C#
>> >> and I don't want my SP to execute for 30 seconds when only 3 sec
> is
>> >> really required.
>> >>
>> >> Any help is appreciated,
>> >>
>> >> Oleg
>> >>
>> >
>> >
>