GenerateBackupSQL Method

SQLServer.Database.TransactionLog Object

Description

Generates a series of Transact-SQL statements that can be used to backup this TransactionLog. Set the properties of a created Backup object as desired and pass it to the GenerateBackupSQL method.

Visual Basic

strScript = TransactionLog.GenerateBackupSQL ( [DumpSpec :=] Backup )

C++

HRESULT pTransactionLog->GenerateBackupSQL (
LPSQLOLEBACKUP
pBackup,
SQLOLE_LPBSTR
pstrScript );

Elements

Element Type Description

strScript String Generated Transact-SQL backup script
Backup Backup Created Backup object that specifies how to execute the transaction log backup

Remarks

To schedule this backup script, set the Task.Command property to the string returned by this method.