一般错误 20018 Cannot Continue the file execution because the session is in the Kill state

General error 20018 Cannot Continue the file execution because the session is in the Kill state

我正在 PHP 使用 Laravel 和 SQL 服务器进行编程。我的老板在系统中使用了一个非常非常长的存储过程。因此,当我们开始上传文件时,存储过程再次需要很长时间,但 4 分半钟后,它 returns 我们出现了这个错误:

SQLSTATE[HY000]: General error: 20018 Cannot continue the execution because the session is in the kill state.

我用谷歌搜索了一下,在 Stack Overflow 上发现了一个问题,但不太确定问题出在哪里,因为如果我们的老板直接运行它,那就是 运行。知道它是在 PHP 端还是在 SQL 服务器端吗?

我建议深入研究 SQL 存储过程,在我看来,当您尝试处理它时它会超时。帮助加快速度的一种方法是将 SP 分解为其他较小的存储过程,然后在代码中调用它们。你能在这里分享SP代码看看发生了什么吗?