Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Find Currently Running Query – T-SQL

Posted on April 29, 2013October 26, 2015 By David Kittell
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
KILL [session_id]

Reference: http://blog.sqlauthority.com/2009/01/07/sql-server-find-currently-running-query-t-sql/

Originally Posted on April 29, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code MSSQL - Audit

Post navigation

Previous post
Next post

Related Posts

MySQL – Table/View Column Information

Posted on March 1, 2014October 26, 2015

Similar to MSSQL – Table/View Column Information, this post will help with MySQL tables and columns. This query is a quick query to give you the pertinent information about a specific table. DESCRIBE <Table Name>; select * from `information_schema`.`columns` WHERE table_name = ‘<Table Name>’; SELECT table_name, Replace(GROUP_CONCAT(CONCAT(column_name, ‘, ‘, table_name)),CONCAT(‘,…

Read More

PowerShell – Get Computer Information

Posted on November 6, 2015November 10, 2015

This script is pieced together from various posts, I only take credit for combining the resources. There is more than initially is seen to this script, based on the code below it will write a text file on c:\ and does need admin privileges in order to run. Right around…

Read More

SQL – Log Parser Studio

Posted on December 4, 2015December 4, 2015

Log Parser Studio is a great free tool from Microsoft TechNet Gallery that allows you to run SQL statements against Log files. This tool is available as a Zip file, once extracted open “LPS.exe”. Two examples are below but there is also a category (Code – SQL – Log Parser…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes