Query times out from application

  • I run a stored procedure from SSMS and it takes only 10ms to complete. The same procedure when called from an application times out after 2 minutes.

    I am totally confused here. Any thoughts on what might be wrong and how to go about troubleshooting the issue ?

  • Sanz

    Perhaps you are supplying different parameters, or maybe your connection settings are different (things like SET ANSI_NULLS). Different connection providers (ODBC, OLEDB and so on) have different default settings.


  • Checked those. The Procedure being executed by both methods(Management Studio and application) is the same. There is no difference in any of settings you mentioned.

  • Sanz (4/6/2011)

    There is no difference in any of settings you mentioned.

    Are you sure? SSMS has different defaults for some of the SET options than ADO.Net does. How did you check the set options?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Does it always take this long for the application?

    What data is being returned? Are there VARCHAR(MAX), TEXT or IMAGE fields?

  • Created non-clustered indexes on some columns as suggested by the execution plan and the result shows up quickly. Now there is no visible change even from the application.


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply