Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
A Backup object allows you to do the following:
Back up a SQL Server database or database transaction log.
Generate a Transact-SQL BACKUP statement defining a backup.
Monitor a backup operation, reporting status to the user.
For SQL Server, a database delimits the largest backup unit. Although many different database backup images can be maintained on any single medium, a backup cannot span more than a single database. By default, backup operations performed with a Backup object back up a complete database.
SQL Server can write a backup to one of the following media types: disk, tape, or a proprietary medium called a backup device.
SQL Server supports backup striping. A striped backup is one directed to more than a single device. When striped, a backup is written across the devices in equal chunks. Striping is supported to a single media type only. For example, a backup can be written to two tape devices, but SQL Server cannot write part of a backup to a tape device and the rest to a disk.
At a minimum, you must supply values for a backup source and a backup target when using a Backup object. The Database property (inherited from BackupRestoreBase class) specifies the backup operation source.
To get Backup object properties, users can be a member of the public fixed server role.
To set Backup object properties, users must have BACKUP DATABASE or BACKUP LOG permissions on the database, or be a member of the db_owner and db_backupoperator fixed database role and the sysadmin fixed server role.
To run the SqlBackup method, users must have BACKUP DATABASE or BACKUP LOG permissions on the database, or be a member of the db_owner and db_backupoperator fixed database role and the sysadmin fixed server role.
This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.