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