Full Backup script in SQL Server

The below script will generate FULL BACKUP Script. After running the below command, copy the output and run the copied script to create Full Database Backup.

Declare @Path VARCHAR(100)
SEt @Path=\'C:\\DatabaseBackup\\\'
Select \'BACKUP DATABASE [\'+name+\'] TO DISK = N\'\'\'+@Path+\'\'+name+\'.bak\'\'
WITH NOFORMAT, NOINIT, NAME = N\'\'\'+name+\'-Full Database Backup\'\', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10\'

from sys.databases
where database_id>4

Leave a comment