In MySQL, you can use the DATE_FORMAT()
function with the %b
format specifier to return the short month name. For example, you can return Jan
or Feb
instead of January
or February
.
Tag: how to
How to Back Up an Azure SQL Edge Database to Local Disk using T-SQL
Microsoft Azure SQL Edge’s backup capabilities are similar to those in SQL Server on Linux, and SQL Server running in containers.
Azure SQL Edge supports T-SQL, and so you can back up your SQL Edge databases by running a T-SQL statement.
In this article, I back up a SQL Edge database to the local disk in my Docker container.
Continue readingGet the Month Name from a Date in SQL
Most major RDBMSs provide at least one function that enables us to return the month name from a date.
Continue reading2 Functions that Return the Month Name from a Date in MySQL
The following two functions enable us to get the month name from a date in MySQL.
Continue readingHow to Backup the Transaction Logs in Azure SQL Edge (T-SQL)
By default, databases created in Azure SQL Edge use the simple recovery model. This means that you can’t perform log backups on these databases.
Fortunately, you can change a database’s recovery model to full recovery mode, which will enable you to back up the logs.
Continue reading2 Ways to Concatenate a String and a Number in Oracle
In Oracle Database, we can concatenate strings and numbers with the CONCAT()
function or the pipe concatenation operator (||
).
How to Change the Recovery Model of a Database in Azure SQL Edge using T-SQL
By default, databases created with Azure SQL Edge use the simple recovery model. This means that you can’t perform log backups on these databases.
If you need to perform log backups on a database created with SQL Edge, you’ll need to change the recovery model of the database to either full or bulk logged.
This can be done with T-SQL with the ALTER DATABASE
statement.
How to Format Numbers in Oracle
In Oracle Database, you can format numbers in many ways.
For example, you can format a number as a currency, with commas and decimal points in the right place. You can specify leading zeros, you can add a fractional part – or remove it, if that’s what’s required.
Continue readingHow to Install SQL Server on an M1 Mac (ARM64)
I previously explained how to install SQL Server on a Mac using the SQL Server for Linux Docker image.
Since then, Apple has released its M1 chip, which uses ARM architecture. This can cause a problem when trying to install SQL Server. The problem is, at the time of writing, SQL Server isn’t supported on the ARM architecture.
Fortunately, there’s an alternative.
Continue readingReturn the Short Day Name from a Date in Oracle
In Oracle Database, we can use the TO_CHAR(datetime)
function to return the various date parts from a datetime value, including the short day name.
The short day name is also referred to as the abbreviated day name. In any case, below are examples of returning the short day name from a date value in Oracle.
Continue reading