Various queries: see what tasks are running, who is connected, and kill task or user
SELECT
      percent_complete ,
      start_time ,
       status,
      command ,
      estimated_completion_time ,
      cpu_time ,
      total_elapsed_time
FROM
       sys.dm_exec_requests
WHERE
      command = ’DbccFilesCompact’
Â
Â
Â
Â
Â
USE master ;
GO
EXEC sp_who ;
GO
Â
Returns list of all running processes and their SIPD’s
   sp_who2
Â
To kill a process
   KILL {SPID}
Â
sp_lock
Â
Â
SELECTÂ *
FROM sys .dm_os_wait_stats
ORDER BY wait_time_ms DESC
GO
Â
Â
Â
SELECTÂ *
FROM sys .dm_os_waiting_tasks
ORDER BY wait_duration_ms DESC
GO
Â
Â
Article ID: 179
Created: January 10, 2015
Last Updated: January 10, 2015
Author: Natural Networks NOC [support@naturalnetworks.com]
Online URL: https://kb.naturalnetworks.com/article.php?id=179