SQLDMO.Backup

Klasse til hådtering af backup.

Eksempel på en backup til fil kan ses hér (VBScript):

Dim objSQLServer
Set objSQLServer = CreateObject( "SQLDMO.SQLServer2" )
objSQLServer.LoginSecure = True

Dim objBackup
Set objBackup = CreateObject( "SQLDMO.Backup2" )
objBackup.Database = "Northwind"
objBackup.Action = SQLDMOBackup_Database
objBackup.Initialize = True
objBackup.Files = "Northwind.bak"

objSQLServer.Connect( "SERVER00\INSTANCE00" )
objBackup.SQLBackup( objSQLServer )
objSQLServer.DisConnect

Set objBackup = Nothing
Set objSQLServer = Nothing

Filen bliver placeret i den default backup folder.

Se også:
SQLDMO.Backup2
SQL Server Books Online
SQLDMO.Restore
SQLDMO.Restore2

Niels Grove-Rasmussen Opdateret 30-01-2008 22:58:38.
Ting Ta'r Tid! Hentet 15-07-2018 22:40:36.