Here are three ways to return the month name from a date in MariaDB.
how to
Subtract a Month from a Date in MariaDB
MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a month (or many months) from a given date.
Here’s an example of subtracting a month from a date in MariaDB.
2 Ways to Get the Default Language of a Login in SQL Server (T-SQL)
There are (at least) a couple of ways you can use T-SQL to return the default language of a specified login in SQL Server.
In particular, you can use the following methods:
- Query the
LOGINPROPERTY()function. - Query the
sys.server_principalssystem catalog view in themasterdatabase.
Examples of these are below.
Rename a User Defined Data Type in SQL Server (T-SQL)
In SQL Server, you can use the sp_rename stored procedure to rename a user created object in the current database, including a user-defined data type.
6 Ways to Add a Month to a Date in MariaDB
MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a month (or many months) from a given date.
Here are 6 ways to add a month to a date in MariaDB.
Bonus update: I’ve now added a 7th way to add a month to a date at the end of this article. So I guess it’s now 7 ways to add a month to a date in MariaDB 🙂
How to do an UPDATE Pass-Through Query in SQL Server
In SQL Server, the OPENQUERY rowset function enables you to execute a pass-through query on a linked server.
OPENQUERY is commonly referenced in the FROM clause of a query as if it were a table, but it can also be referenced as the target table of an INSERT, UPDATE, or DELETE statement.
This article presents an example of using OPENQUERY to do an UPDATE pass-through query.
Return the Language used for Date & Time Functions in MariaDB
MariaDB has a lc_time_names system variable that controls the language used by the DAYNAME(), MONTHNAME() and DATE_FORMAT() date and time functions.
Here’s how to return the value of that variable.
How to Show all Locales in MariaDB
MariaDB supports a large list of locales that are used by functions such as DAYNAME(), MONTHNAME() and DATE_FORMAT().
While these locales are available to MariaDB, by default they’re not loaded into any of the system tables, so you can’t run a query to retrieve them.
However, MariaDB provides a plugin that does load these into a table. Once the plugin has been installed, you can query that table to return the locales available in MariaDB.
6 Ways to Add a Year to a Date in MariaDB
MariaDB provides several ways to add a year or a certain number of years to a given date. For example, you might want to add 1 year, 10 years, 30 years, etc.
Here are 6 ways to add a year to a date in MariaDB.
How to Subtract Minutes from a Datetime Value in MariaDB
Here are some options for subtracting one or more minutes from a datetime expression in MariaDB.