sp_whoisactive
sp_WhoIsActive is a SQL Server stored procedure for real-time activity monitoring across SQL Server 2005–2022 and Azure SQL DB. It provides detailed visibility into running queries, locks, and resource usage through a single T-SQL script installation.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | amachanic/sp_whoisactive |
| Owner | amachanic |
| Primary language | TSQL |
| License | GPL-3.0 — OSI-approved |
| Stars | 1.4k |
| Forks | 339 |
| Open issues | 19 |
| Latest release | 20260409 (2026-04-10) |
| Last updated | 2026-05-16 |
| Source | https://github.com/amachanic/sp_whoisactive |
What sp_whoisactive is
A T-SQL stored procedure that captures session-level activity metadata including query execution, blocking chains, and resource consumption. Supports multiple SQL Server versions via versioned script folders (2008, 2019, current) and uses semantic versioning tied to minimum/maximum supported SQL Server releases.
Get the sp_whoisactive source
Clone the repository and explore it locally.
git clone https://github.com/amachanic/sp_whoisactive.gitcd sp_whoisactive# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Execute sp_WhoIsActive.sql in SQL Server Management Studio against the target database (or master for instance-wide access); no external deployment infrastructure required.
- Version selection is critical: use 2008/ folder for SQL 2008 R2 and earlier, 2019/ for 2012–2019, root folder for 2022+ and future versions.
- Script installs as a stored procedure; verify permissions and schema placement (dbo. vs. custom schema) before production deployment.
- Running the procedure consumes minimal CPU; test impact on busy instances, particularly when capturing full query plans or large result sets.
- Output can be captured to a table for post-analysis or piped to monitoring/logging systems via PowerShell or T-SQL jobs.
When to avoid it — and what to weigh
- Proprietary Closed-Source Requirements — GPLv3 license requires derivative works and integrations to remain open-source; not compatible with closed-source commercial products without legal review.
- Need for Third-Party Commercial Support — Community-maintained project with no formal SLA or vendor support; relies on GitHub issues and maintainer goodwill.
- Centralized Multi-Instance Monitoring Dashboard — Designed as a single-instance stored procedure; does not provide built-in aggregation, alerting, or UI for managing many SQL Server instances.
- Automated Long-term Historical Trending — Point-in-time activity snapshot tool; does not retain or visualize metrics over time without external scripting or tooling.
License & commercial use
GPLv3 (GNU General Public License v3.0). Code is open-source and freely available. Derivative works, modifications, and distributions must remain open-source under GPLv3.
GPLv3 permits internal commercial use (e.g., running the procedure for your own monitoring). However, if you modify the script or integrate it into a proprietary product for resale/distribution, you must open-source those additions and distribute under GPLv3. Do not assume you can ship this in a closed-source commercial monitoring tool without legal review.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Requires SQL Server login with permission to execute procedures and query system views; typical DBA role. No inherent code injection vulnerabilities reported, but users should review the T-SQL source and audit execution context. GPLv3 source is publicly auditable. No built-in authentication, encryption, or role-based output filtering; restrict execution to trusted administrators.
Alternatives to consider
SQL Server Management Studio Activity Monitor
Native, built-in GUI for basic session monitoring; requires no installation but less granular control and scripting integration than sp_WhoIsActive.
Extended Events (XE)
Microsoft's modern event tracing engine for deep diagnostics; more flexible and lower overhead but steeper learning curve and requires separate capture/analysis tooling.
Third-party SaaS monitoring (e.g., SolarWinds DPA, Redgate SQL Monitor)
Commercial, vendor-supported solutions with dashboards, alerting, and multi-instance aggregation; require licensing and ongoing fees but eliminate GPL compliance burden.
Build on sp_whoisactive with DEV.co software developers
Ensure your team understands GPLv3 compliance, test the script in a non-prod environment matching your SQL Server version, and plan integration with your existing monitoring and alerting workflows.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
sp_whoisactive FAQ
Can I use sp_WhoIsActive in a commercial product?
Which SQL Server versions are supported?
Does it work with Azure SQL DB?
What happens if I run it on a production instance?
Work with a software development agency
Need help beyond evaluating sp_whoisactive? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.
Ready to integrate sp_WhoIsActive?
Ensure your team understands GPLv3 compliance, test the script in a non-prod environment matching your SQL Server version, and plan integration with your existing monitoring and alerting workflows.