Author: Peter Whyte

  • sqlcmd Examples (SQL Server)

    The sqlcmd utility allows you to execute Transact-SQL commands directly from the command line using ODBC, enabling SQL Server batch execution without the need for a GUI. This post contains sqlcmd examples to help you understand it more. sqlcmd is essential for running SQL queries, automating tasks, and…

    Read More


  • How to Rename Schema’s in SQL Server

    Changing the schema of a table in SQL Server can be a rare task for database administrators but a more common requirement for database developers. This guide walks through how to move a table from one schema to another using the ALTER SCHEMA statement. During my time as…

    Read More


  • Adding & Removing SQL Features via Command

    This post will guide you on how to add and remove features from SQL Server via the command line. The process includes checking installed features, installing a new feature (such as replication), and uninstalling a feature when no longer needed. The following areas will be covered within this…

    Read More


  • Install/Uninstall SQL Server via Command

    Installing and uninstalling SQL Server via command line can be useful, especially in environments without a GUI. In this guide, I’ll walk through installing SQL Server on Windows Server Core, in a local Hyper-V test environment. At the end I’ll also uninstall SQL Server from a PowerShell terminal…

    Read More


  • Guide for Setting Up Windows Server Core

    When you need to setup Windows Server Core, it’s useful to first familiarize ourselves with the key PowerShell commands that configure the server. Windows Server Core is a minimal installation option that provides a lightweight, command-line interface (CLI)-only environment, making it ideal for environments requiring lower resource usage…

    Read More


  • Joining a Windows Host to a Domain

    This post contains a demo of joining a Windows Server onto a test Domain, which I created in my previous post (Installing Active Directory on Windows Server 2016). Joining a Windows Computer to Active Directory Domain Services is required in 99% of Corporate environments, and is usually a…

    Read More


  • Installing Active Directory on Windows Server 2016

    This post contains a demo installation of Active Directory Domain Services on Windows Server 2016. It follows a previous post for a series of test lab configuration posts. Microsoft docs on installing AD on Windows Server can be found here: Install Active Directory Domain Services Configuring a Windows…

    Read More


  • Installing Windows Server 2016 with Hyper-V

    This post contains a demo of installing the Windows Server 2016 Operating System on Hyper-V. To install the Hyper-V Role on Windows 10, see this guide from Microsoft Docs: Install Hyper-V on Windows 10. There are two parts to this one:> Create a new Hyper-V Virtual Machine> Install…

    Read More


  • Resolving “Windows could not start the SQL Server”

    If you encounter the message “Windows could not start the SQL Server on 127.0.0.1”, it signifies a problem preventing the SQL Server service from starting properly. This error is broad and can stem from various causes. Diagnosing the Issue To uncover the root cause, we can check Windows…

    Read More


  • Resolving “Index was out of range” in SSMS

    This post is here to help if you’ve encountered the following error while performing a task in SQL Server Management Studio (SSMS): Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index (mscorlib) In my experience, I’ve seen this…

    Read More