Skip to content

FULLBACKUP

OVERWRITING:
============
BACKUP DATABASE [DATABASENAME]
TO DISK = ‘U:\Backup\FULL_DB.bak’
WITH COPY_ONLY, NOFORMAT, INIT, NAME = N ‘Full Database Backup’,
SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
 
APPENDING:
==========
BACKUP DATABASE [DATABASENAME] TO
DISK = ‘U:\Backup\FULL_DB.bak’
WITH COPY_ONLY, RETAINDAYS = 14, NOFORMAT, NOINIT, NAME = N’Full Database Backup’,
SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
 
BACKUP INTO TWO PARTS WITH COMPRESSION(OVERWRITING):
===================================================
BACKUP DATABASE [DATABASENAME] TO
DISK = N’U:\Backup\FullDB_part1.bak’,
DISK = N’U:\Backup\FullDB_part2.bak’
WITH COPY_ONLY, NOFORMAT, INIT, NAME = N’Full Database Backup’,
SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
GO
 
BACKUP INTO TWO PARTS WITH COMPRESSION(APPENDING):
===================================================
BACKUP DATABASE [DATABASENAME] TO
DISK = N’U:\Backup\FullDB_part1.bak’,
DISK = N’U:\Backup\FullDB_part2.bak’
WITH COPY_ONLY, RETAINDAYS = 14, NOFORMAT, NOINIT, NAME = N’Full Database Backup’,
SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
GO
 
CREATING BACKUP USING DATE STAMPS:
==================================
USE DATABASENAME
DECLARE @pathName NVARCHAR(512)
SET @pathName = ‘U:\Backup\FullBACKUP_’ + Convert(varchar(8), GETDATE(), 112) + ‘.bak’
BACKUP DATABASE AdventureWorksDW2008R2 TO DISK = @pathName WITH NOFORMAT, NOINIT, NAME = N’FullBackup’, SKIP, NOREWIND, NOUNLOAD, STATS = 10
Go
Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: