How to check who has killed the job which was running?if logs are not generated

3.1K    Asked by CameronOliver in SQL Server , Asked on Sep 4, 2021

Unspecified error occurred on SQL Server. Connection may have been terminated by the server. This is error I am getting.(when the job is executed) [SQLSTATE HY000] (Error 0) Cannot continue the execution because the session is in the kill state. [SQLSTATE HY000] (Error 596). The step failed. what is sql server kill process?

Answered by Carolyn Buckland

For sql server kill process, you can use the KILL SPID command to kill a particular user session. You can only KILL the user processes. Once we kill a session, it undergoes through the rollback process, and it might take time and resources as well to perform a rollback. I suggest you to check errorlog for the time when the error occured. It could be not "kill", for example I saw the same error when DBCC CHECKDB was executing, the job was failed with the same error Unspecified error occurred on SQL Server. Connection may have been terminated by the server. It was a session that put the database in single_user with rollback immediate The errorlog has no killing message but it did reported the spid that put the db in single user. To find a login who did it I searched in the default trace by the execution time as well, there was a row reporting EventClass = 164 and ObjectType = 16964 that corresponds to alter database, DatabaseName reported was the database of interest and SessionLoginName was that I was looking for



Your Answer

Interviews

Parent Categories