Created
November 22, 2014 15:55
-
-
Save jordanfarrer/1af1aedde4279a0eabd1 to your computer and use it in GitHub Desktop.
Full Database Backup Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @BackupPath nvarchar(512) = '<Directory Path of Destination Folder>' | |
DECLARE @BackupName nvarchar(512) = '<Name of Backup File>' | |
DECLARE @FullBackupPath nvarchar(512) = @BackupPath + '\' + @BackupName + '.bak' | |
BACKUP DATABASE <Database Name> | |
TO DISK = @FullBackupPath | |
WITH FORMAT, | |
MEDIANAME = @BackupName, | |
NAME = '<Backup Name>' | |
-- REMEMBER: Add the SQL Server user to be able to write to the destination directory | |
-- SQL Server user can be found by looking at the Services -> SQL Server -> Log On properties page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment