Expert Software Company : News

miercuri, 19 mai 2010

SQL Server Backup

Local loserver, lnCounter, loBackupDevice

loserver=Createobject("SQLDMO.SqlServer")
loserver.Connect("MiServidor","MiUserName","MiPassword")

If loserver.BackupDevices.Count = 0
loBackupDevice = Createobject("SQLDMO.BackupDevice")

With loBackupDevice
.Name = "MyBackup"
.PhysicalLocation = "C:\MyBackups\BackupFile.bak"
.Type = 2 && SQLDMODevice_DiskDump
Endwith

loserver.BackupDevices.Add(loBackupDevice)
Else

For lnCounter = 1 To loserver.BackupDevices.Count
? loserver.BackupDevices(lnCounter).PhysicalLocation
Next lnCounter

Endif

Niciun comentariu:

Trimiteți un comentariu