Author: Peter Whyte
-
DBA Scripts: Get Backup Coverage
Most production SQL Server environments have backup jobs configured. The question that actually matters is whether those jobs are running, and succeeding, for every database that needs them. A database added last month might never have been folded into the backup plan. A job that’s been failing silently for weeks looks identical to a healthy…
Written by
-
DBA Scripts: Get Instance Configuration Snapshot
Every sp_configure setting on an instance tells a small story: a value someone changed deliberately, a value nobody’s touched since install, or a value that’s been changed but is still waiting for RECONFIGURE or a restart to actually take effect. Without a full snapshot, most of that story is invisible, and configuration drift between servers…
Written by
-
Understanding WHERE 1=1 and WHERE 1=2 in SQL Queries
⚡Neither changes the plan or the speed of a query. WHERE 1=1 lets every real condition start with AND, so conditions can be commented out or appended in dynamic SQL. WHERE 1=2 returns no rows without reading the table, which is how SELECT … INTO copies a table’s columns and nothing else. You have opened…
Written by
-
DBA Scripts: Get MAXDOP Configuration
Max Degree of Parallelism is one of the first things worth checking on any server, and one of the most commonly wrong. The default of 0 lets a single query use every scheduler on the box, which sounds efficient until 20 concurrent OLTP queries all decide to go parallel at once and end up fighting…
Written by
-
DBA Scripts: Get Memory Configuration and Usage
Max Server Memory is the single most important memory setting on any SQL Server instance, and it’s astonishing how often it’s left unconfigured. Without a cap, SQL Server will happily consume nearly all available RAM for its buffer pool, leaving too little for the OS, and on a box running other services, that ends in…
Written by
-
How to Open PowerShell as Administrator on Windows
Running PowerShell as Administrator is required for many system-level tasks such as configuring Windows, installing software, or running administrative scripts. If a command fails unexpectedly, one of the first things to verify is whether the PowerShell session is actually elevated. Below are the most reliable ways to open PowerShell with elevated privileges on Windows. Quick…
Written by
-
DBA Scripts: Get Version and Edition
Version and edition are two of the most basic facts about a SQL Server instance, and two of the easiest to get wrong when you’re relying on memory or an out-of-date wiki page. Whether a feature is available, whether a security patch has actually landed, and how many cores or how much memory the edition…
Written by
-
What the USE Command Does in SQL Server
The USE command changes the database context for the current session. Every statement in SQL Server runs in the context of a database. When you run USE, you are telling SQL Server which database subsequent statements should execute against until the context changes again or the session ends. That single behaviour explains a lot of…
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)