In SQL Server, the CAST()
function converts an expression of one data type to another.
Here’s a quick overview of the function with examples.
Continue readingIn SQL Server, the CAST()
function converts an expression of one data type to another.
Here’s a quick overview of the function with examples.
Continue readingBelow is a list containing the SQL Server data types, in order of precedence.
Continue readingSQL Server has three recovery models; simple, full, and bulk logged. Each database uses one of these settings.
Backup and restore operations occur within the context of the recovery model of the database
You can change the recovery model of a database by using the ALTER DATABASE
statement along with the SET RECOVERY
option.
If you’re trying to back up the transaction logs in a SQL Server or SQL Edge database, but you get an error that states BACKUP LOG cannot be performed because there is no current database backup, you’ll need to perform at least one full backup of the database before you attempt to back up the transaction logs.
Continue readingIn Azure SQL Edge, you can query the sys.databases
catalog view to see the recovery model for each database.
If you get an error that reads The statement BACKUP LOG is not allowed while the recovery model is SIMPLE when trying to back up a database in SQL Server or Azure SQL Edge, it’s because you’re trying to back up the transaction logs on a database that uses the simple recovery model.
To fix this, change the recovery model to either full or bulk logging.
Continue readingIn SQL Server, the TODATETIMEOFFSET()
function was specifically designed to return a datetimeoffset value from a datetime2 value.
Given the fact that the datetime2 data type doesn’t actually support time zone offsets, and datetimeoffset must contain the offset, the TODATETIMEOFFSET()
function allows you to specify a time zone offset to use.
This article provides some examples to demonstrate.
Continue readingIn SQL Server, you can use the LOGINPROPERTY()
to return information about login policy settings.
This includes being able to return data for bad password attempts, as well as the time of the last failed login attempt due to a bad password.
Continue readingMicrosoft 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 readingBy 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 reading