🛠️Part of the SSMS Complete Guide, installing, configuring and fixing SQL Server Management Studio. In modern versions of SQL Server Management Studio, line numbers are enabled by default. If you are running SSMS 21 or newer, you will already see line numbers in query windows without changing anything. Older versions of SSMS did not enable…
Adding columns to tables in SQL Server is a routine task, but it is not always a harmless one. On small tables it is trivial. On large or business-critical tables, especially those involved in replication or heavy write workloads, it can introduce blocking, transaction log growth, or downstream latency if handled carelessly. This post walks…
Restoring a database in SQL Server is a core DBA task. Whether you’re responding to an incident, performing disaster recovery testing, migrating data, or rebuilding an environment, restores need to be predictable, repeatable, and verifiable. This post walks through restoring a database using both T-SQL and SQL Server Management Studio, along with the checks that…
Seeing a database stuck in Recovery mode usually happens at the worst possible time. It often appears after a restart, a restore, or an unexpected shutdown, and the immediate question is always the same: Is this normal, or do I need to intervene? This post explains what recovery mode actually means, how to tell whether…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Security xp_cmdshell lets any login with EXECUTE permission on it run arbitrary operating system commands from inside SQL Server. It’s genuinely useful for a handful of legacy automation tasks, and it’s also one of the first things a penetration tester checks for, because…
🚨Part of the SQL Server Errors series, the exact messages and what actually causes them. You may see this error when trying to access a database during or after a restore: Msg 927 · Level 14 · State 2 Database “[DatabaseName]” cannot be opened. It is in the middle of a restore. It is easy…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability Is Every Replica Actually Ready to Take Over An Availability Group only protects you if every secondary replica is actually connected, synchronized, and healthy at the moment you need it. A replica that quietly dropped its connection hours ago looks identical…
When you need to drop, restore, or change database settings, active user sessions often get in the way. SQL Server will block these operations until all connections are cleared. In busy environments, waiting is rarely practical. This post shows a safe, deliberate, and review-first way to identify and kill all user sessions connected to a…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: High Availability How Far Behind Is Each Database, Really Availability Group Replica State answers whether a replica is connected and generally healthy. It doesn’t answer the database-level question that actually matters during an incident: how much data is sitting in the send queue…
🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Backup & Recovery Checking the last backup times is one of the first things worth doing when you sit down at a SQL Server instance, whether it’s one you’ve owned for years or one you inherited an hour ago. Before making changes, running…
Access (4) Always On Availability Groups (4) Auditing (7) Backups (6) Blocking (4) Blocking Locking (6) Collectors (7) Database Backups & Recovery (8) Database Backups and Recovery (5) Database Maintenance (7) DBA Tools (24) Disk Space (5) Error Log (3) Extended Events (8) Features (6) High Availability (6) Indexes (7) Installation (7) Inventory (8) Maintenance (6) Migration (14) Monitoring (27) Performance (21) Performance Troubleshooting (9) PowerShell (4) Query Behaviour (5) Security (10) SQL Agent (5) SQL Scripts (17) SQL Server Administration (10) SQL Server Configuration (7) SQL Server Errors (5) SQL Server High Availability (4) SQL Server Internals (3) SQL Server Management Studio (SSMS) (6) SQL Server Monitoring (7) SQL Server Networking (9) SQL Server Security (7) Storage and Capacity (7) T-SQL (10) Temp DB (3) Tracing (7) Transaction Logs (4) Troubleshooting (24) Windows Server (4)