467,861 Members | 1,504 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,861 developers. It's quick & easy.

strange query timeout

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
Jul 20 '05 #1
  • viewed: 9387
Share:
4 Replies
Stefano (stefano.larosa@_Cancellatequesto.fastwebnet.it) writes:
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.


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, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
> 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.

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
Jul 20 '05 #3
Yep, look for the timeout on your ADO components. This will override
the timeout settings from SQL (if smaller).
Jul 20 '05 #4
Correct. This is a big gotcha.

On Mon, 15 Dec 2003 23:22:29 +0000 (UTC), Erland Sommarskog
<so****@algonet.se> wrote:
the Command object does not inherit it from the Connection object.


Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by siggy2 | last post: by
reply views Thread by Philip.M.Collins | last post: by
17 posts views Thread by jensen bredal | last post: by
6 posts views Thread by Gary | last post: by
reply views Thread by ivb | last post: by
1 post views Thread by traceable1 | last post: by
17 posts views Thread by Terry Olsen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.