How to Get the Recovery Model of a Database in SQL Server using T-SQL

In SQL Server, a recovery model is a database property that controls how transactions are logged, whether the transaction log requires (and allows) backing up, and what kinds of restore operations are available. Databases can use one of the following three recovery models: simple, full, and bulk-logged.

You can query the sys.databases catalog view to get a list of databases and their recovery models.

Continue reading

Fix MySQL Warning 1287: ‘BINARY expr’ is deprecated and will be removed in a future release

If you get warning number 1287 that reads ‘BINARY expr’ is deprecated and will be removed in a future release. Please use CAST instead when running a query in MySQL, it’s because you’re using the BINARY operator.

The BINARY operator is deprecated as of MySQL 8.0.27.

To fix the issue, cast the value to binary using the CAST() function instead.

Continue reading

Fix Msg 241 “Conversion failed when converting date and/or time from character string” in SQL Server

If you’re getting SQL Server error Msg 241 that reads Conversion failed when converting date and/or time from character string, it’s probably because you’re trying to convert a string to a date/time value, but that particular string can’t be converted to the date/time type specified.

Continue reading