Worth Corner, Crawley, RH10 7SL

Support Hours - Mon-Sat, 8.00-18.00

Welcome to our SQL Server blog

This blog was created in order to pass on some of our knowledge and advice in the hope that the community might find it useful.

Obviously Microsoft SQL Server is our area of expertise and therefore this is our most thorough blog with everything from the basic through to the the incredibly advanced and, as such, we should have something for everyone within our pages.

Backup a Database Using TSQL
Published: Jan 27, 2014
This is actually the cleanest and quickest way to produce a backup as it is a one line command in the form of:

BACKUP DATABASE <database_name> TO DISK = <backup_device>

In this following example I want to make a backup of the boredDBA database to a folder on my C drive:

backup database boredDBA to disk = 'c:\backup\boredDBA.bak'

This produces a full backup of the boredDBA database. The following are the commands to perform a Differential and Transactional backup respectively:

backup database boredDBA to disk = 'c:\backup\boredDBA.dif' with differential

backup log boredDBA to disk = 'c:\backup\boredDBA.trn'

As you can see, it’s very simple to perform your backups with scripts and therefore with just a few tweaks (maybe adding a timestamp to your backup file name, for example) you can quickly create a simple scheduled task to run your custom backup strategies.

Leave a Comment
Your email address will not be published. All fields are mandatory.
NB: Comments will only appear once they have been moderated.

SQL  World  CEO
Kevin  Urquhart

iPhone Selfie

I am a SQL Server DBA, Architect, Developer, Trainer, and CEO of SQL World. This is my blog in which I’m simply trying to share my SQL knowledge and experiences with the world.


© Copyright 2020 SQLTraining Ltd.