Skip to content

BACKUP

BACKUP DATABASE YourDatabase
TO DISK = '/path/to/your/directory/YourDatabase.bak'

BACKUP DATABASE successfully processed 0 pages in 120.036 seconds (0.000 MB/sec)

In the above example code, the SQL BACKUP DATABASE statement is used to create a full backup of YourDatabase to a specified disk location. In this case, the path for backup is /path/to/your/directory/YourDatabase.bak.

The output statement signifies that the backup process was successful and displays the time it took to complete the backup along with the transfer rate (in MB/sec).

Please note this syntax can vary depending upon the SQL distribution you’re using. This example is based on Microsoft SQL Server. MySQL does not support the BACKUP DATABASE command. You may have to use mysqldump or similar tools.