-1

I observed that xp_cmdshell is in KILLED/ROLLBACK state in my SQL server and consuming memory from tempdb.

I tried to get the PID for this session id and the source server from which it was generated, I could not find the PID in source server tasklist.

Is there any way to stop this xp_cmdshell without restarting SQL server.

jarlh
  • 42,561
  • 8
  • 45
  • 63
Krishna508
  • 11
  • 5

1 Answers1

0

In windows, XP_CMDSHELL creates a new dependent CMD process on the machine where SQL Server is installed (not on the machine from where XP_CMDSHELL is triggered, It can be triggered from a remote machine using SSMS).

You will find a process with user name as MSSQLSERVER in task manager on that machine. You got to end this process as well.

enter image description here

PankajSanwal
  • 956
  • 7
  • 14
  • "You will find a process with user name as MSSQLSERVER in task manager on that machine. You got to end this process as well." Could not find any such task – Krishna508 Jun 17 '22 at 03:58
  • @Krishna508, just confirming if you checked the process in the Machine where the Database server is installed? – PankajSanwal Jun 17 '22 at 06:13
  • Yes I checked the process in the Machine where the Database server is installed. – Krishna508 Jun 23 '22 at 03:38
  • Currently, XP_cmdshell total elapsed time in my SQL server is -50372673..... Why is it showing in -ve ?? – Krishna508 Jul 21 '22 at 08:19