Author: Peter Whyte
-
Enabling TCP Connections in SQL Server
TCP/IP must be enabled in SQL Server for remote connections to work. If it’s disabled, applications can’t connect; even if authentication, ports, and firewall rules are all correct. This post shows two reliable ways to enable TCP connections in SQL Server: Both approaches require a service restart before changes take effect. When You Need to…
Written by
-
How to Show Line Numbers in SSMS
🛠️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…
Written by
-
How to Add Columns to Tables in SQL Server
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…
Written by
-
How to Restore a Database in SQL Server
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…
Written by
-
Why Is the Database in “In Recovery” Mode?
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…
Written by
-
DBA Scripts: Get Database Mail and xp_cmdshell Configuration
🔧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…
Written by
-
Database Cannot Be Opened – It Is in the Middle of a Restore
🚨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…
Written by
-
DBA Scripts: Check AG Replica Role and Synchronization State
🔧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…
Written by
-
Kill All User Sessions on a Database in SQL Server
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…
Written by
-
DBA Scripts: Check Always On Availability Group Latency
🔧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…
Written by
Start Here
- DBA Scripts: The Complete Guide
- Run a Full Health Check
- DBA Scripts & Tools
- SSMS: The Complete Guide
- SQL Server Errors: The Complete Guide
- Wait Types Library
The Pillars
Blog Categories
- Backups & Recovery (16)
- DBA Scripts (151)
- High Availability (HA) (12)
- Installation & Configuration (38)
- Maintenance (24)
- Migration & Upgrades (14)
- Monitoring (6)
- Performance Tuning (35)
- Security (Encryption & Permissions) (20)
- Storage & Capacity (14)
- T-SQL Fundamentals (11)
- Troubleshooting (54)
- Wait Types (235)
Latest Posts
- SQL Server Login Migration: What Gets Silently Left Behind
- CREATE USER WITHOUT LOGIN vs Contained Database Users
- The sqldba MCP Server: Give Your AI Assistant a Verified SQL Server Reference
- Cannot Resolve the Collation Conflict (Error 468)
- Logical Consistency-Based I/O Error in SQL Server (Errors 823 and 824)
- Cannot Recover the Master Database (Error 3417) and What the Log Actually Says
Blog Tags
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)