Author: Peter Whyte

  • Count 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 CSV files, this demo will walk you through how to count the rows of all CSV files within a folder. Counting rows within CSV files may…

    Read More


  • Exporting SQL Server Query Results to CSV

    This post contains a guide on how to export data from a SQL Server database using SSMS. SSMS, SQL Server Management Studio, is the standard application that most people use to run queries for a Microsoft SQL Server Database. The default export option in SSMS is set as…

    Read More


  • How to Check Table Sizes in SQL Server

    There are many ways to check the size of a table in SQL Server. The way you will do it will likely depend on what your task at-hand is. For example, a quick look at the Disk Usage by Top Tables report on a database you’ve never seen…

    Read More


  • Backing Up a SQL Server Database

    Backing up a database is something I’ve always found easier done within a query window. There’s not much to it; That’s what I’m used to writing. I’ve no need to worry about the copy_only option these days, or check SQL Server Editions to see if I can use…

    Read More


  • Restoring a SQL Server Database

    This is a simple guide to restoring a full backup file in SQL Server, providing an overview of a few options that are available during the process. It is always a good idea to read through Microsoft’s documentation on database restores before proceeding. This will ensure that you…

    Read More


  • Copying Dates into Excel

    There’s often a need to quickly copy/paste a database query output into an Excel sheet, rather than exporting as a .csv file. When you do this for a DATETIME column though, it’ll show up in Excel looking something like this. I don’t think Excel likes the milliseconds. This…

    Read More


  • Stack Exchange Data Explorer

    As a DBA, I’ve found Stack Exchange Data Explorer to be a really useful tool for exploring and analyzing the data from the Stack Exchange network of websites. It’s kind of like having a SQL playground where you can run all sorts of queries and see what insights…

    Read More


  • Monitoring Database Growth Events in SQL Server

    Database growth events occur when a SQL Server database file reaches its capacity and automatically grows to accommodate more data. These events are configured in the database properties, where you can define growth increments in MB or GB. Properly configuring these settings is important for maintaining performance, as…

    Read More


  • Show Line Numbers in SQL Server Management Studio (SSMS)

    This is a tip on how to show line numbers in the SQL Server Management Studio (SSMS) query window. This is useful when you receive an error message with reference to a line in your code, although it’s not a necessity to have it enabled as you’ll see…

    Read More


  • Reset Default PostgreSQL User Password

    A common scenario working with Postgres is when you have forgotten your default Postgres user password. This is the password you will have entered during your Postgres installation. This is a guide on how to reset the default Postgres user password. This should hopefully help you resolve this…

    Read More