SQL Backup 5.3   

Using the Command Line

See Also

SQL Backup provides a command line interface so that you can run your backup and restore operations in script and batch files. Note that you cannot use the command line to back up or restore databases on remote servers; you must use the extended stored procedure or the graphical user interface with SQL Backup Pro.

Before you use the command line, you are recommended to use the graphical user interface until you are familiar with the SQL Backup features and tools.

The SQL Backup command line executable is SQLBackupC.exe. It is located in the folder in which you installed the SQL Backup server components; for example, C:\Program Files\Red Gate\SQL Backup\<instance name>. For details, see Installing and Upgrading SQL Backup.

To enter a command using the command line interface, you use a subset of the Transact-SQL BACKUP and RESTORE statements. For example, to back up the pubs database, you use the following command:

SQLBackupC -SQL "BACKUP DATABASE pubs TO DISK = 'C:\Backups\pubs.sqb' WITH PASSWORD = 'MyPassword'"

For details of the parameters you can use with the command line, see Toolkit Parameters.

Accessing SQLBackupC.exe from other locations

You can set up your system so that you can access the SQL Backup command line executable SQLBackupC.exe from your current location without typing the full path.

To make the executable accessible to all users, add the SQL Backup installation path to the System PATH environment variable; to make the executable accessible only to the current user, add the SQL Backup installation path to the User PATH environment variable. You can access the Environment Variables property page from the Advanced tab of the System Properties. Refer to your Microsoft® Windows® documentation for details.

 

 

 


© Red Gate Software Ltd 2008. All Rights Reserved.