Time out period not elapsed, but still timing out (see code)?

后端 未结 3 1098
太阳男子
太阳男子 2021-01-07 10:52

OK I keep getting this error after about 3-4 minutes of churning:

 Timeout expired.  The timeout period elapsed prior to completion of the operation or the s         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-07 11:14

    This is an example of an extremely bad re-use of code. Instead of reusing the stored proc which makes you loop through all input variables you want, write a new set-based proc that selects the information based on joins. It will be much faster (assuming you have properly indexed of course). In accessing databases, you do not want to do something through a loop or a cursor if a set-based alternative is possible.

提交回复
热议问题