strange query timeout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stefano

    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


  • Erland Sommarskog

    #2
    Re: strange query timeout

    Stefano (stefano.larosa @_Cancellateque sto.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
    SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

    Comment

    • louis nguyen

      #3
      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

      Comment

      • Ryan

        #4
        Re: strange query timeout

        Yep, look for the timeout on your ADO components. This will override
        the timeout settings from SQL (if smaller).

        Comment

        • Ellen K.

          #5
          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]

          Comment

          Working...