O'Reilly logo

SQL Server 2012 T-SQL Recipes: A Problem-Solution Approach by Jonathan Gennick, Wayne Sheffield, Andy Roberts, David Dye, Jason Brimhall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 26

image

Backup

By David Dye

In this chapter, you’ll find recipes covering several methods of backing up a database using T-SQL. This chapter is in no way meant to be a comprehensive source for database backups but rather provides greater insight into the problems or limitations you may encounter. This chapter will outline the different types of backup methods using T-SQL as well as how to query the msdb database to find information about backup information.

26-1. Backing Up a Database

Problem

You want to do a full backup of the AdventureWorks2012 database to your C:\Apress\ folder using T-SQL.

Solution

Execute a BACKUP DATABASE statement. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required