How to backup a SQL database from a query or stored procedure.

  SQL Advanced

To make a database backup you need to use a simple code exemplified below.

 

Code:

BACKUP DATABASE PRIDEMO TO DISK = ‘C:\MIS\PRIDEMO.BAK’ WITH CHECKSUM

BACKUP DATABASE [DATABASE NAME] TO DISK = ‘[DETINATION FULL PATH]’ WITH CHECKSUM