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 18-03-2019 01:25:45.
Ting Ta'r Tid! Hentet 19-04-2019 12:44:05.