The solution is meant to be scheduled as a job in SQL Server Agent or Windows Task Scheduler.

General syntax:
Example on basic command line statement:

Parameter name Parameter type Parameter syntax Parameter description
AddFull boolean { Yes | No } Take both full and diff/log if full backup is missing.
BackupPath string { <backup path> | null } If "null" the defult backup path of the database instance is used.
BlockSize integer { <block size> | null } Blocksize in bytes. See supported values in BOL. If "null" default size is used.
BufferCount integer { <number of buffers> | null } Total number of I/O buffers.
CheckSum boolean { Yes | No }  
Compression boolean { Yes | No | null } if "null" the default compression is used. If compression is chosen but not supported, the execution fails.
ComputerName string { <computer name> | null } if "." or "null" the local host is used.
CopyOnly boolean { Yes | No }  
DbName string { All | System | User | <database name(-)> }

List of databases to backup.More databases are seperated by comma (,). Wildcard can be used: $, *

DbInstanceName string {<database instance name> | . | null } If "." or "null" the defaul database instance is used.
Description string { <description> | null } Description of backup. Max 255 chars.
Execute boolean { Yes | No } If "No" the commands are shown but not executed.
ExpireDate date { <expiredate> | null } Date where backup set can be overwritten. Precedence below RetailDays.
File string { <file(-s)> | null } Files to be included in the backup.
FileCount integer { <number of files> | null } Number of files the backup is made to. If "null" backup is taken to one file.
Filegroup string { <filegroup(-s)> | null } Filegroups to be included in the backup. If "null" all filegroups are included in the backup.
Help     Show command line help
MaxTransferSize integer { <transfer size> | null } Largest unit in Bytes between database instance and backup media.
Name string { <backup name> | null } Name of backup. Max 128 chars. If "null" backup name is autogenerated.
RetainDays integer { <retain days> | null } Number of days before backup can be overwritten. Precedence above ExpireDate.
Type string { FULL | DIFF | LOG }  
Verify boolean { Yes | No }  

Defaults are underlined.

Example: Full backup of all user databases


Last edited Jun 15, 2011 at 7:24 PM by NielsGrove, version 11


No comments yet.