SQL DBA Blog: Home

  • Forcing Encrypted Connections in SQL Server Using Certificates

    In the previous post, we looked at how to verify what protocol and encryption SQL Server is actually using at runtime. That answers the question: What is happening on the wire right now? This post answers a different one: How do I make sure every TCP connection is encrypted, every time? Forcing encryption in SQL…

    read more

  • Difference Between DELETE and TRUNCATE in SQL Server

    When someone asks: “What’s the difference between DELETE and TRUNCATE?” Most answers stop at: That is technically correct. It is also not enough. In production environments, choosing between DELETE and TRUNCATE is not about syntax. It is about: This post focuses on the production impact, not the textbook answer. Quick Technical Comparison Feature DELETE TRUNCATE…

    read more

  • Backing Up a SQL Server Database with Encryption

    Encrypted backups are no longer optional in most environments. If backups leave the server, land on shared storage, or are retained long-term, unencrypted backups are a data leak waiting to happen. SQL Server has supported native backup encryption since SQL Server 2012, but the mechanics still catch DBAs out. usually during a restore, not a…

    read more

  • Troubleshooting Database Mirroring Issues in SQL Server

    Database Mirroring is deprecated, but you will still see it in many production environments. It was officially marked deprecated in SQL Server 2012 and has remained in that state for well over a decade. In my own career as a DBA, it has been “deprecated” the entire time, yet still widely deployed and fully supported.…

    read more

  • Get Current Date & Time in SQL Server

    Getting the current date and time in SQL Server is straightforward. Choosing the correct function for your workload is what matters. Whether you’re stamping audit rows, logging ETL runs, or investigating production issues, SQL Server exposes several built-in functions with different precision and return types. All of these functions use the Windows OS clock of…

    read more

  • Creating SQL Logins on an Availability Group (AG) Environment

    In an Availability Group, the databases fail over. Your SQL logins do not. For Windows domain logins, the SID is owned by AD, so you just create the login on each replica and it syncs up. For SQL logins, the SID is generated inside SQL Server. If the SID differs between replicas, the database user…

    read more

  • Grant VIEW SERVER STATE in SQL Server

    VIEW SERVER STATE is the permission that unlocks most server-level DMVs and DMFs. If someone can’t run basic instance health checks and keeps hitting permission errors, this is usually why. It gives visibility into what is happening on the box right now: active sessions, running requests, waits, connection details, and plan cache level query stats.…

    read more

  • How to Get the SQL Server IP Address

    When troubleshooting connectivity, firewall rules, or unexpected routing, you often need one simple answer: which IP address and port did my session actually connect to? SQL Server can listen on multiple IPs (and listeners can resolve to multiple addresses), so the hostname in your connection string does not always tell you what you really hit.…

    read more

  • SQL Server Error Severities Explained

    When SQL Server raises an error, it includes more than just a message. Every Database Engine error contains the following: Out of all of these, severity is the fastest way to understand how serious the issue is and who is likely responsible for fixing it. Severity levels range from 0 to 24 and indicate whether…

    read more

  • 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…

    read more