Dear Microsoft, please fix the Windows Taskbar

I recently got an ultra wide screen and realised that the Windows taskbar is a bit of waste. Let me explain. On an ultra wide screen, the task bar will be very likely just empty most of the time, taking up the precious Y axis of the screen: Since there are many more...

When to use negative identity

The identity value in relational databases is a field that increases automatically. It is often used to create surrogate primary keys. Surrogate keys Surrogate keys are meaningless and are only used to uniquely identify the row, not the data itself. For example,...

How I use dbatools to automate SQL Server installs

I lot of you have asked me to expand on the automated SQL Server installation I mentioned in my previous article: Why I use VMware Workstation instead of Hyper-V on my laptop dbatools is a free PowerShell module with over 500 SQL Server best practice, administration,...

Use CONTEXT_INFO to avoid firing triggers

DML Triggers are commonly used to apply some business rules to the data in the table. The most common implementation would be updating the date_updated column automatically whenever the data in the table changes. For the illustration, this can be done with a following...

Rapid SQL Server test instances with Docker and Azure

As a DBA, developer, and more importantly the creator of SQLWATCH.IO, I need the ability to rapidly deploy and test different SQL Server configurations or test different upgrade variations from one version of SQLWATCH to another. This is quite laborious,...

How to intelligently auto-cycle ERRORLOG using T-SQL

In my earlier post, I described different ways to read very large SQL Server Log (ERRORLOG) – 5GB – to be exact. However, this was a reaction to something that has already happened. In this post, I will show you how to prevent this from happening at...

Add colours to the ERRORLOG

When dealing with large logs I often find it difficult to find the information we are looking for. To make it easier, we can use PowerShell to add colours the ERRORLOG based on string patterns Note this will only work when using the Select-String command....

Ransomware and SQL Server – how to protect data

What is ransomware Ransomware is a type of malicious software that locks access to user files until a ransom is paid. Quite common “locking mechanism” is by encrypting all files on a user computer, server or even the entire network. Encryption is a process...

How to read large SQL Server ERRORLOG (the 5GB test)

I often come across large ERRORLOG mainly because they are not being recycled frequent enough, or not at all. Sometimes, despite the frequent recycling, the ERRORLOG can grow to an unmanageable size. This has recently happened to me during a large transaction rollback...