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
You want to do a full backup of the AdventureWorks2012 database to your C:\Apress\ folder using T-SQL.
Execute a BACKUP DATABASE statement. ...