Search code examples
phpsqlsql-serverlaravelsession-state

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


I'm programming in PHP using Laravel and SQL Server. My boss is using a really, really long stored procedure in the system. So when we start uploading the file, it takes a long time, again, for the stored procedure, but after 4 and a half minutes, it returns us this error:

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

I googled it and i found one question on Stack Overflow, but not really sure where the problem is, because if our boss runs it directly, it's running. Any idea if it is on PHP side or the SQL Server side?


Solution

  • I would suggest diving into the SQL Stored Procedure, sounds like to me that its timing out when you try to process it. One way to help speed things up is to breakup the SP into other smaller Stored Procedures and then in the code just call them up. Can you share the SP code here to see what is going on?