How can I drop a SqlServer Backup Device using SMO in C#?

Posted by C-Pound Guru on Stack Overflow See other posts from Stack Overflow or by C-Pound Guru
Published on 2010-03-18T17:08:27Z Indexed on 2010/03/18 17:11 UTC
Read the original article Hit count: 438

Filed under:
|
|

I can drop a SqlServer Backup Device using SQL-DMO using the following pseudo-code:

SQLDMO.SQLServer2 server = New SQLDMO.SQLServer2();
server.Connect("myserver");
server.BackupDevices.Remove("mybackupdevice");
File.Delete("mybackupdevicephysicallocation");

SMO.Server.BackupDevices does not appear to have a Remove() method, so how can I drop a BackupDevice using SMO?

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql-server