Author: Peter Whyte

  • Creating a Linked Server to SQL Server

    Linked Servers in SQL Server allow you to query external databases, such as remote SQL Server instances, Oracle, ODBC or MS Access databases. It provides easy query access to another database server for users, however it’s not the most efficient ways to do it. The following steps should…

    Read More


  • Database Growth Events in SQL Server

    When a database file reaches its maximum allocated size, a growth event is triggered to expand the file and allow for more data storage. The size of these growth events can be configured in the database options or by using the ALTER DATABASE statement, as demonstrated below. Properly…

    Read More


  • Setting Maximum Database File Sizes in SQL Server

    Setting maximum database file sizes in SQL Server is something you’d ideally not have to set, but it’s a good last resort option available if you need it. The reason I say this is because, you never want a production database to stop updating/inserting data due to a…

    Read More


  • Updating Help Documentation in PowerShell

    The Update-Help cmdlet in PowerShell will download the latest help files for PowerShell modules installed on your machine. Running PowerShell as Administrator is a requirement for this one, else you’ll get the following error. “Access is denied” is the key part in this error, amongst a lot of…

    Read More


  • Moving TempDB Files in SQL Server

    It’s a solid best practise to have TempDB files stored in separate drive, away from your C: drive. This is because TempDB can grow very large, very quickly (within minutes); depending on workloads of course, and this can happen on both the TempDB 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

    If you’ve lost a database log file and you’re in critical need of the data, well… that would never happen ( ͡° ͜ʖ ͡°) Nevertheless, this is might be a handy random fact to know, that you can attach a data (.mdf) file without the associated log (.ldf)…

    Read More


  • Backup & Restore (WITH FILE)

    In this post I’m going to show what the WITH FILE = X option does when backing-up or restoring a SQL Server database. microsoft_documentation The first thing we need to know is that a backup file can contain multiple databases, and even multiples of the same database. If you…

    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


  • Using Custom Connection Colours in SSMS

    SQL Server Management Studio (SSMS) is the tool that most SQL Server user queries are run from. It has an option that allows you to change the colour of your query banner, which is useful if you want visually mark a server that you work with every day.…

    Read More