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…
-
Track Database Growth Events Over Time in SQL Server
SQL Server’s default trace captures database and log file growth events, but it’s short-lived. Once the trace rolls over or the instance restarts, that history is gone. If you want to understand growth patterns over time, react less to disk alerts, and stop guessing which databases are mis-sized, you need to store those events somewhere.…
-
How to Show Line Numbers in SSMS
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 them by default, which is why many guides still focus on “turning them on”.…
-
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…
-
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…
-
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…
-
Database Cannot Be Opened – It Is in the Middle of a Restore
You may see the following error when attempting to access a database during or after a restore operation: Database “[DatabaseName]” cannot be opened. It is in the middle of a restore. This message is easy to misinterpret, especially during incidents or maintenance windows.It does not indicate corruption or failure by itself. This error means the…
-
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…
-
Estimate Backup and Restore Completion Time in SQL Server
When a database backup or restore is running, one of the first questions is simple: How long does it have left? SQL Server exposes estimated completion information for active backup and restore operations. You can query it directly to see progress, elapsed time, and an approximate finish time without guessing or relying on external tooling.…
-
Get Last Database Backup Times in SQL Server
Checking the last backup times is one of the first things to do when reviewing a SQL Server instance. Before making changes, running maintenance, or troubleshooting issues, you need to know whether reliable recovery points actually exist. This post shows a fast, reliable way to check the most recent full, differential, and transaction log backups…