sql timeout from web application problem (works good in sql server

Discussion in 'ASP .Net' started by dave, Dec 3, 2008.

  1. dave

    dave Guest

    I have a query that returns in less than 2 seconds when i run from sql
    enterprise manager (sql2005) However..when a user enters criteria and hits
    'search' which executes the identical query the query time's out.
    In a test environment I profiled sql server and captured the identical
    query. I can execute that just fine through query analyzer.
    I have set the command and connection timeout to 5 minutes (way more than
    required) however i still get an error like the following...

    SQL Exception Information:
    ErrorId: -2
    Message: Timeout expired. The timeout period elapsed prior to completion of
    the operation or the server is not responding.
    Line Number: 0
    Procedure:


    So the question is how is running through the web application different
    against a sql server database. The only difference that i can think of is
    that there may be different protocol that may be used between these two
    different interfaces to sql server.

    Any ideas would be great appreciated. I have been chasing this sort of
    thing for many months.
    thx -dave
     
    dave, Dec 3, 2008
    #1
    1. Advertising

  2. dave

    sloan Guest

    Google
    "Parameter Sniffing" "Sql Server"


    "dave" <> wrote in message
    news:...
    >I have a query that returns in less than 2 seconds when i run from sql
    > enterprise manager (sql2005) However..when a user enters criteria and hits
    > 'search' which executes the identical query the query time's out.
    > In a test environment I profiled sql server and captured the identical
    > query. I can execute that just fine through query analyzer.
    > I have set the command and connection timeout to 5 minutes (way more than
    > required) however i still get an error like the following...
    >
    > SQL Exception Information:
    > ErrorId: -2
    > Message: Timeout expired. The timeout period elapsed prior to completion
    > of
    > the operation or the server is not responding.
    > Line Number: 0
    > Procedure:
    >
    >
    > So the question is how is running through the web application different
    > against a sql server database. The only difference that i can think of is
    > that there may be different protocol that may be used between these two
    > different interfaces to sql server.
    >
    > Any ideas would be great appreciated. I have been chasing this sort of
    > thing for many months.
    > thx -dave
     
    sloan, Dec 3, 2008
    #2
    1. Advertising

  3. dave

    daveh551 Guest

    Re: sql timeout from web application problem (works good in sqlserver

    On Dec 3, 12:26 pm, "sloan" <> wrote:
    > Google
    > "Parameter Sniffing" "Sql Server"
    >
    > "dave" <> wrote in message
    >
    > news:...
    >
    > >I have a query that returns in less than 2 seconds when i run from sql
    > > enterprise manager (sql2005) However..when a user enters criteria and hits
    > > 'search' which executes the identical query the query time's out.
    > > In a test environment I profiled sql server and captured the identical
    > > query.  I can execute that just fine through query analyzer.
    > > I have set the command and connection timeout to 5 minutes (way more than
    > > required) however i still get an error like the following...

    >
    > > SQL Exception Information:
    > > ErrorId: -2
    > > Message: Timeout expired.  The timeout period elapsed prior to completion
    > > of
    > > the operation or the server is not responding.
    > > Line Number: 0
    > > Procedure:

    >
    > > So the question is how is running through the web application different
    > > against a sql server database.  The only difference that i can think of is
    > > that there may be different protocol that may be used between these two
    > > different interfaces to sql server.

    >
    > > Any ideas would be great appreciated.  I have been chasing this sort of
    > > thing for many months.
    > > thx -dave


    Just a guess, but if it's not returning in some reasonable time, I
    would look at not the query but at whether or not it's actually
    connecting to the server at all. Are other queries running okay? If
    so, then maybe this one doesn't have the connection set the way you
    think it does. Or possibly, running unders IIS, it's connecting to
    the server as a different user than you think, or that it doesn't have
    the right access permissions. I'm not sure how you would go about
    diagnosing it, but that's where I would look.
     
    daveh551, Dec 4, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Devlin
    Replies:
    0
    Views:
    704
    Simon Devlin
    Jan 20, 2004
  2. Replies:
    0
    Views:
    473
  3. Replies:
    1
    Views:
    6,348
  4. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,334
    Brian Candler
    Oct 6, 2004
  5. Replies:
    0
    Views:
    174
Loading...

Share This Page