mike

mike

  • NA
  • 25
  • 0

smo.Backup overwriting other backup locations

Mar 1 2010 9:04 AM

hey,
I have a database with two different backups added in the Backups.. menu in SQL Server Manager.  When i back up my database through code via the following code, it removes both of my other backup locations and replaces it with the one the code creates.  Does anyone know how to add a location, and not replace the current ones in there!?
 

Backup bk = new Backup();
string backupFile = dbname + "newbak.bak";
bk.Action =
BackupActionType.Database;
bk.Devices.AddDevice(backupFile,
DeviceType.File);
bk.Database = dbname;
bk.Incremental =
false;
bk.LogTruncation =
BackupTruncateLogType.Truncate;
bk.SqlBackup(server);

Answers (1)