In MariaDB, JSON_INSERT()
is a built-in function that inserts data into a JSON document, and returns the result.
Category: DBMS
Database Management Systems
Restore a SQL Server Database (T-SQL)
If you use SQL Server Management Studio (SSMS) or some other GUI to manage your databases, you might be used to backing up and restoring databases using “point and click”.
Usually this involves right-clicking on the database and selecting Restore or similar, then following the prompts (for example, when restoring a database in Azure Data Studio).
But if you ever need to do it with T-SQL, you can use the RESTORE DATABASE
statement.
MariaDB JSON_DEPTH() Explained
In MariaDB, JSON_DEPTH()
is a built-in function that allows you to check the depth of a JSON document.
It accepts the JSON document as an argument, and returns the maximum depth of the document.
Continue readingMariaDB JSON_EXISTS() Explained
In MariaDB, JSON_EXISTS()
is a built-in function that allows you to check whether a value exists at a specified path in the JSON document.
It accepts the JSON document as an argument, and returns 1
if the path is found, and 0
if it’s not.
The MariaDB documentation states that the function “determines whether a specified JSON value exists in the given data”. However, the function doesn’t actually appear to check for a given value. It’s probably more accurate to say that it determines whether a specified path exists, or that a value exists at the specified path.
For checking that the actual value exists, you can use the JSON_CONTAINS()
function.
2 Ways to Get the Short Month Name from a Date in MariaDB
Here are two ways to return the short month name from a date in MariaDB.
Continue readingMariaDB JSON_QUERY() Explained
In MariaDB, JSON_QUERY()
is a built-in function that returns an object or array from a JSON document, based on the path provided.
It’s similar to the JSON_VALUE()
function, except that it returns an object or array instead of a scalar (JSON_VALUE()
returns a scalar).
MariaDB JSON_VALUE() Explained
In MariaDB, JSON_VALUE()
is a built-in function that returns a scalar value from a JSON document. More specifically, it returns the scalar specified by the path provided.
MariaDB JSON_MERGE_PATCH() Explained
In MariaDB, JSON_MERGE_PATCH()
is a built-in function that merges two or more JSON documents and returns the result.
The JSON_MERGE_PATCH()
function is an RFC 7396-compliant replacement for the JSON_MERGE()
function, which has been deprecated.
MariaDB JSON_MERGE_PRESERVE() Explained
In MariaDB, JSON_MERGE_PRESERVE()
is a built-in function that merges two or more JSON documents and returns the result.
JSON_MERGE_PRESERVE()
is a synonym for JSON_MERGE()
, which has been deprecated. To avoid future issues, you should use the JSON_MERGE_PATCH()
function instead. The JSON_MERGE_PATCH()
function is an RFC 7396-compliant replacement for JSON_MERGE()
.
MariaDB JSON_MERGE() Explained
In MariaDB, JSON_MERGE()
is a built-in function that merges two or more JSON documents and returns the result.
The JSON_MERGE()
function has been deprecated, and to avoid future issues, you should use the JSON_MERGE_PATCH()
function instead. The JSON_MERGE_PATCH()
function is an RFC 7396-compliant replacement for JSON_MERGE()
.