Fix: “The statement BACKUP LOG is not allowed while the recovery model is SIMPLE” in SQL Server (and SQL Edge)

If you get an error that reads The statement BACKUP LOG is not allowed while the recovery model is SIMPLE when trying to back up a database in SQL Server or Azure SQL Edge, it’s because you’re trying to back up the transaction logs on a database that uses the simple recovery model.

To fix this, change the recovery model to either full or bulk logging.

Read more

Add a Time Zone Offset to a datetime2 Value in SQL Server (T-SQL)

In SQL Server, the TODATETIMEOFFSET() function was specifically designed to return a datetimeoffset value from a datetime2 value.

Given the fact that the datetime2 data type doesn’t actually support time zone offsets, and datetimeoffset must contain the offset, the TODATETIMEOFFSET() function allows you to specify a time zone offset to use.

This article provides some examples to demonstrate.

Read more

How to Concatenate Strings in SQL

Most of the major RDBMSs provide several options for concatenating two or more strings.

  • There’s the CONCAT() function, which concatenates its arguments.
  • There’s also a CONCAT_WS() that allows you to specify a separator that separates the concatenated strings.
  • And there’s also a string concatenation operator, which allows us to concatenate its operands.

Below are examples of each method.

Read more

How to Install SQL Server on an M1 Mac (ARM64)

Update January 2026: When I wrote this article in 2021, the full SQL Server image couldn’t be installed on Apple Silicon machines (the M1 Macs). We had to install SQL Edge instead, which is why I wrote this article. Fortunately, things have progressed since then, and we can now install the full SQL Server image on Apple Silicon machines (including M1, M2, M3, M4).

Therefore, I recommend you read How to Install SQL Server on a Mac in 2026 instead of this article. It’s a very similar process to the one outlined in this article, but it actually installs SQL Server instead of SQL Edge (which has since been retired).

Read more