Category: DBA Engineering
-
How to Right-Size SQL Server Database Files
Auto-growth is not the problem. Unplanned, reactive growth is. When database files are undersized, SQL Server is forced to extend them repeatedly under load. Each growth event introduces a pause. If those pauses occur during peak workload, they can cause noticeable latency, increased I/O pressure, and in some cases application timeouts. Right-sizing database files is…
-
Working with SQL Server Database Master Keys
SQL Server uses an encryption hierarchy to protect secrets such as credentials, asymmetric keys and certificates. At the database level, that hierarchy is anchored by the database master key (DMK). Because all other encrypted objects depend on it, losing access to the DMK can render those objects unusable. This post walks through how to: It also…
-
RAND() vs NEWID() in SQL Server
Most people searching for “random numbers in SQL Server” want one of two things: SQL Server gives you two common tools for this: RAND() and NEWID(). They solve different problems, and confusion usually starts when they are treated as interchangeable. This post shows how to use both, starting with simple examples, and explains why they…
-
Understanding WHERE 1=1 and WHERE 1=2 in SQL Queries
In SQL, you will often see queries written using WHERE 1=1 or WHERE 1=2. At first glance, both look pointless. One is always true, the other always false. In practice, both are deliberate patterns used for query construction and control, not filtering logic. They exist to make SQL safer, easier to manipulate, and more predictable…
Blog Categories
Latest Posts
- Troubleshooting Database Mirroring Issues in SQL Server
- Get Current Date & Time in SQL Server
- Creating SQL Logins on an Availability Group (AG) Environment
- Grant VIEW SERVER STATE in SQL Server
- How to Get the SQL Server IP Address
- SQL Server Error Severities Explained
Blog Tags
Always On Availability Groups (4) Database Backups & Recovery (10) Database Maintenance (7) DBA Tools (29) Performance Troubleshooting (9) PowerShell (4) Query Behaviour (4) Schema Changes (1) SQL Agent (1) SQL Interview Questions (1) SQL Scripts (25) SQL Server Administration (9) SQL Server Configuration (7) SQL Server Errors (5) SQL Server High Availability (4) SQL Server Internals (4) SQL Server Management Studio (SSMS) (7) SQL Server Monitoring (10) SQL Server Networking (9) SQL Server Replication (1) SQL Server Security (8) SQL Server Versions (2) Storage and Capacity (14) T-SQL (9) Transaction Logs (8) Troubleshooting (14) Windows Server (4)