devxlogo

SQL

Putting a NULL Date Value Last

Sometimes when presenting your query’s value, you end up with NULL values, obviously. The irritating thing about NULL values, especially with NULL Date values, is that when you attempt to

Find out When the Last Full Backup was Taken

The following query shows the last time a full backup was taken on a certain database. select database_name as [Database], a.name [NameOfBackup], user_name as [BackupTakenBy],backup_start_date, backup_finish_date, backup_size as [SizeOfBackup], is_copy_only,has_backup_checksums,

Backup and Restore an SQL Database

Sometimes when trying to backup and restore a database from another database SQL Server throws errors saying that the database is in use. To get around this quite frustrating error,