• Setting Maximum Database File Sizes in SQL Server

    This post shares how to set maximum database file sizes in SQL Server, capping your database file size limits for proper disk space management. Configuring maximum database file sizes in SQL Server is often considered a safeguard or tactical measure rather than a primary strategy. Ideally, you want…

    Read More


  • Updating Help Documentation in PowerShell

    Keeping your PowerShell help documentation up to date ensures you always have the latest guidance and reference materials for installed modules. The Update-Help cmdlet allows you to download and install the most recent help files, but you may encounter an access denied error if PowerShell is not run…

    Read More


  • How to Move Temp DB Files in SQL Server

    It’s a solid best practice to store temp db files on a separate drive, away from your C: drive. This is because temp db can grow very large, very quickly, sometimes within minutes depending on workloads. This growth affects both the temp db data (.ndf) and log (.ldf)…

    Read More


  • The SSMS Import Flat File Feature

    The Import Flat File feature within SQL Server Management Studio (SSMS) was introduced in December 2017 (14.0.17213.0). This is a streamlined version of the Import Data feature and it minimises the user intervention during a file import. Unlike the Import data feature, you don’t have the option to…

    Read More


  • Attaching SQL Databases Without Log Files

    In a perfect world, you’d never lose a database log file. But when the unexpected happens and you urgently need the data from a database, knowing how to attach a SQL Server database without its log (.ldf) file can be a lifesaver. This guide walks you through the…

    Read More


  • SQL Server Backup & Restore WITH FILE Option

    When you back up a SQL Server database, multiple backups can be stored in a single file. The WITH FILE = X option allows you to choose a specific backup version from a single backup file. Here’s what happens: – WITH FILE = 1: Restores the first backup…

    Read More


  • Applying Data Retention to a SQL Table

    In SQL Server, there’s often a need to delete old data from a database table. This could be for reasons like adhering to GDPR policies, managing oversized tables that are slowing down operations, staying within SQL Server Express’s 10GB limit, or simply cleaning up application logs and errors.…

    Read More


  • How to Change Connection Colours in SSMS

    SQL Server Management Studio (SSMS) is the go-to tool for running SQL Server queries. One of its handy features is the ability to change the colour of the query banner, providing a visual indicator of the server environment you are connected to. This feature can be especially beneficial…

    Read More


  • Counting Rows within CSV Files using PowerShell

    This post contains a script that will help count rows within multiple CSV files using PowerShell. If you have a directory containing many CSV files, this’ll help you count the rows of each CSV file within the folder. Counting rows within CSV files may be useful for verifying…

    Read More


  • Exporting SQL Server Query Results to CSV

    This guide explains how to export a SQL Server query results to a CSV file using SSMS. SQL Server Management Studio (SSMS) is the primary tool used for managing SQL Server databases and running queries. By default, SSMS exports data in a column-aligned format, but to export data…

    Read More


Useful SQL DBA Posts

Performance & High Availability
– Get Full SQL Server System Info Fast
– Quick Performance Troubleshooting Scripts
Identify Missing & Unused Indexes
– Get Wait Stats & Top Consuming Queries
Get Exclusive Locks on Tables
Get Always On Availability Group (AAG) Latency
Get Mirroring Status & Latency
Get Replication Latency
Get Last Node Blip in SQL Server FCI
Security & Maintenance
Get Estimated Database Backup/Restore Time
Get Last Database Backup Dates/Times
– Get Database Sizes & Space Used
How to Get Table Sizes
Get Index & Heap Fragmentation Levels
Get SQL User Permissions and Roles
Creating SQL Users on Availability Groups
– Audit Failed Login Attempts

Tags

Always On Availability Groups (AAG) (4) Certificates & Encryption (3) Change Data Capture (CDC) (2) Database Admin (76) Database Backups & Recovery (14) Database Mirroring (2) Deleting Data (1) Error Messages (5) Git Commands (5) Importing & Exporting Data (2) Linked Servers (3) Linux Admin (2) Logging & Monitoring (1) Measuring Databases (10) Microsoft Patching (2) PowerShell Scripts (1) SQL Server Agent (5) SQL Server Database Files (1) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (15) SQL Server Network Connectivity (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance (5) SQL Server Permissions (2) SQL Server Processes (5) SQL Server Replication (2) SQL Server Scripts (13) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (19)