sql server - c# Log SQL Actions for Restore and Backup of DB -
is there way write sql actions log file when doing restore or backup of db in c#? code have restore example.
restore restore = new restore { database = databasename, action = restoreactiontype.database, replacedatabase = true }; restore.devices.adddevice(mydbbackup, devicetype.file); restore.replacedatabase = true; restore.norecovery = false; serverconnection con = new serverconnection(@".\myinstance"); server sqlserver = new server(con); backup source = new backup(); restore.sqlrestore(sqlserver);
cheers
Comments
Post a Comment