none
Query Time Out RRS feed

  • 問題

  •  

    Sorry, It's me again.

    I would like to ask help on the Query time out issue.


    I have a Web Service which will connect to a sql 2005 database and call the store procedure to retrive data. The store procedure contains some select table statements only.

     

    Don't know why, I usually got the "Time Out Error" when executing this simple sql statement in the web service.

    I did to execute the same store procedure in the SQL Server Management Studio, it's fine. I can get the result data in 30  10 seconds.

    Does anybody know what's happening ?

     

    Thx!

    2008年8月25日 上午 03:01

解答

  • Running the query in mgmt studio is totally different from it is being executed in your code. The time out perhaps caused by your code in your Web method, high utilization of your Web server, application pooling problem of your Web application, etc.

    For the error of CXPACKET, you may check out this KB: http://support.microsoft.com/kb/293232

     

    Regards,

    Colt

    2008年8月25日 上午 05:11

所有回覆

  •  lai_waiman wrote:
    I can get the result data in 30  10 seconds.

     

    What do you mean of 30 10 seconds?

     

    BTW, your problem looks like something wrong in the Web server, rather than the database server. But it depends on the volume of data and activity / health of your Web server. You may try to increase the time out value in your data access web method first and see does it help, it may help you to find out the bottleneck is at your Web server or database server first.


    Regards,

    Colt

    2008年8月25日 上午 03:29
  •  

    Thx for ur quick reply , Colt.

    What I mean is 10-30  Seconds. Sorry for the typing error.


    The Default query timeout time is 3 mins, right? 
    The volumn of the data is sometime large. 

    But what I don't understand is, if I can get the result in 30 seconds through the SQL Management Studio located in my own PC. What makes the query time out in the Web Service located in the Web Server?

    Another strange thing is, when the Timeout is going to appear, "Wait Type : CXPACKET " will appear in the Activity Monitor.

    Thx again, Colt!

    2008年8月25日 上午 03:50
  • Running the query in mgmt studio is totally different from it is being executed in your code. The time out perhaps caused by your code in your Web method, high utilization of your Web server, application pooling problem of your Web application, etc.

    For the error of CXPACKET, you may check out this KB: http://support.microsoft.com/kb/293232

     

    Regards,

    Colt

    2008年8月25日 上午 05:11