Connecting Tech Pros Worldwide Forums | Help | Site Map

strange query timeout

Stefano
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi everibody,
it's the first time i post on this newsgroup. I'm Stefano from Milano,
italy.
I'm a beginners with Sql2000. My problem is this.
I run a View using enterprise manager and after less then 20 second it goes
in error time out. I run this view using a VB application and the error
comes again .When i run it with Query Analyzer after 50 seconds it give me
the right result.
i've tried to change the value of querytimeout using sp_configure with the
same bad result.

i've tried to change the ado command timeout in visul basic but still
doesn't work.

any suggest ?

Thanks in advance



Erland Sommarskog
Guest
 
Posts: n/a
#2: Jul 20 '05

re: strange query timeout


Stefano (stefano.larosa@_Cancellatequesto.fastwebnet.it) writes:[color=blue]
> I run a View using enterprise manager and after less then 20 second it
> goes in error time out. I run this view using a VB application and the
> error comes again .When i run it with Query Analyzer after 50 seconds it
> give me the right result.
> i've tried to change the value of querytimeout using sp_configure with the
> same bad result.
>
> i've tried to change the ado command timeout in visul basic but still
> doesn't work.[/color]

The timeout is purely a client-side thing, so sp_configure is not going
to help you. (That one is for distributed queries, when the SQL Server is
the client to another server.)

QA has a query command which 0 by default, that is no timeout. Good boy.

EM has a default timeout of 30 seconds, and may be changeable, but maybe
not for everything.

In VB, the property .CommandTimeout is your man. But you may have to set
it both on the Connection object and the Command object. I believe that
the Command object does not inherit it from the Connection object.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
louis nguyen
Guest
 
Posts: n/a
#3: Jul 20 '05

re: strange query timeout


> Hi everibody,[color=blue]
> it's the first time i post on this newsgroup. I'm Stefano from Milano,
> italy.
> I'm a beginners with Sql2000. My problem is this.
> I run a View using enterprise manager and after less then 20 second it goes
> in error time out. I run this view using a VB application and the error
> comes again .When i run it with Query Analyzer after 50 seconds it give me
> the right result.
> i've tried to change the value of querytimeout using sp_configure with the
> same bad result.[/color]
Hi Stefano,

It appears that the core problem is that the query takes too long.
Run it in Query Analyzer with the "show execution plan" enabled. The
execution plan will explain what MSSQL is doing. Optimizing queries is
a trial and error process. Good luck. - Louis
Ryan
Guest
 
Posts: n/a
#4: Jul 20 '05

re: strange query timeout


Yep, look for the timeout on your ADO components. This will override
the timeout settings from SQL (if smaller).
Ellen K.
Guest
 
Posts: n/a
#5: Jul 20 '05

re: strange query timeout


Correct. This is a big gotcha.

On Mon, 15 Dec 2003 23:22:29 +0000 (UTC), Erland Sommarskog
<sommar@algonet.se> wrote:
[color=blue]
>the Command object does not inherit it from the Connection object.[/color]

Closed Thread