In SQL Server, the NULLIF()
expression checks the value of two specified expressions. It returns a null value if they’re equal, otherwise it returns the first expression.
Category: DBMS
Database Management Systems
Set 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 set the value of that variable.
Continue readingFix Msg 529 “Explicit conversion from data type int to xml is not allowed” in SQL Server
If you’re getting SQL Server error Msg 529 that reads something like Explicit conversion from data type int to xml is not allowed, it’s probably because you’re trying to perform a data type conversion that’s not permitted.
SQL Server doesn’t allow certain conversions. If you try to perform such a conversion, you’ll get this error.
Continue reading4 Functions to Return the Month from a Date in MariaDB
Below are 4 functions that enable you to return the month from a date in MariaDB.
Continue readingDROP TABLE IF EXISTS Example in PostgreSQL
In PostgreSQL, we can use the IF EXISTS
clause of the DROP TABLE
statement to check whether the table exists or not before dropping it.
2 Ways to Return Just the Numeric Values from a SQLite Database Column
The following SQLite examples return only those rows that have numeric values in a given column.
Continue readingFix Msg 8116 “Argument data type varchar is invalid for argument 1 of session_context function” in SQL Server
If you’re getting SQL Server error Msg 8116 with the message Argument data type varchar is invalid for argument 1 of session_context function, it’s because you’re passing the wrong data type to a function – in this case the SESSION_CONTEXT()
function.
3 Ways to Return the Time Zone from a Datetime Value in Oracle
Below are three ways to return time zone information from a datetime value in Oracle Database.
Continue readingSet the Character Set and Collation of a Column in MariaDB
You can specify the character set and collation at various levels in MariaDB. You can specify them at the connection level, the server level, the database level, the table level, and even the column level.
You can also specify a collation in your queries so that it overrides any collation that has been previously specified at the aforementioned levels.
Continue reading2 Ways to List all Functions in MySQL
Below are two options we can use to return a list of functions in MySQL.
Continue reading