Reputation: 782
What are the user's (SQL) roles needed to take a SQL Server database backup using the SMO Backup
class in C# as shown below? Does it use Windows authentication?
Server myServer = new Server(servername);
Backup bkp = new Backup();
bkp.Action = BackupActionType.Database;
Database myDatabase = myServer.Databases[database];
bkp.Database = myDatabase.Name;
bkp.Devices.AddDevice(path, DeviceType.File);
bkp.BackupSetName = string.Format("{0} database Backup", database);
bkp.BackupSetDescription=string.Format("{0} database - Full Backup", database);
bkp.Initialize = true;
bkp.SqlBackup(myServer);
Upvotes: 1
Views: 1479