Category: DBA Scripts
-
DBA Scripts: Get Failed Login Summary
The error log is full of Login failed for user ‘sa’. One script groups every failure by login, client address and reason, adds the lockout state, and tells a scan from a stale password or a missing database.
Written by
-
DBA Scripts: Get Identity Column Usage
Find every SQL Server identity column close to its data type limit, before inserts fail with Msg 8115: arithmetic overflow converting IDENTITY to int.
Written by
-
DBA Scripts: Get Log Shipping Status
Log shipping secondary behind, or a 14420 or 14421 alert just fired? Run this on the monitor server to see the backup, copy and restore ages side by side and which job stopped.
Written by
-
DBA Scripts: Enable or Disable All SQL Agent Jobs
Turning every SQL Agent job off is easy. Turning the right ones back on is where it goes wrong. Save the state first, disable with sp_update_job, restore from what you saved, and know why disabling does not stop a running job.
Written by
-
The sqldba MCP Server: Give Your AI Assistant a Verified SQL Server Reference
The reference behind this site, as six tools an AI assistant can call: error numbers, wait types, patch levels and scripts, hand-verified rather than scraped. It never connects to your SQL Server, and it refuses rather than guessing.
Written by
-
DBA Scripts: Migration and Deployment
A SQL Server migration fails in two places: before it starts, when nobody checked whether the workload even fits the target, and after it finishes, when logins don’t match, users are orphaned, and the first Monday morning proves the move wasn’t as done as it looked on Friday. The scripts in this area cover the…
Written by
-
DBA Scripts: SQL Server Change Management
Change window open and you need the checklist or the rollback criteria now? Start Here goes straight to them. The rest is the paperwork either side of the window: how a change gets approved, proved safe before you start and undone if it goes wrong, which is what decides whether it goes ahead on a…
Written by
-
DBA Scripts: Get Database Summary
One Row Per Database, Every Issue Flagged in One Column Checking every database on an instance one at a time, state here, recovery model there, backup age in a third window, doesn’t scale, and it’s exactly the kind of routine check that gets skipped when things are busy. The gaps that matter (a database nobody’s…
Written by
-
DBA Scripts: Get Database Inventory
One Query, Every Database’s Migration Readiness Before you migrate, upgrade, or consolidate anything, you need one honest answer per database: is it actually online, what recovery model is it running, and is its compatibility level going to surprise you on the target server. Digging that out of SSMS one database properties dialog at a time…
Written by
-
DBA Scripts: Pre-Install and Post-Install Checks for SQL Server
You are standing up a new SQL Server instance, or you have inherited one and want to know what state it is really in. These 2 read-only PowerShell scripts sit either side of setup: pre-install-check.ps1 tells you whether the machine is ready before you run setup.exe, and post-install-validation.ps1 tells you what the installer left at…
Written by
- Tune a Slow Query With Copilot in SSMS
- xp_readerrorlog: Read the SQL Server Error Log with T-SQL
- Cannot Drop Database Because It Is Currently in Use (Error 3702)
- Could Not Drop Login Because the User Is Currently Logged In (Error 15434)
- Set a Maximum Database File Size in SQL Server (MAXSIZE)
- SQL Server Activity Monitor in SSMS (and the Performance Dashboard)
- Backups & Recovery (18)
- DBA Scripts (154)
- High Availability (HA) (13)
- Installation & Configuration (60)
- Maintenance (25)
- Migration & Upgrades (14)
- Monitoring (10)
- Performance Tuning (38)
- Security (Encryption & Permissions) (25)
- Storage & Capacity (18)
- T-SQL Fundamentals (17)
- Troubleshooting (108)
- Wait Types (236)