Save the database schema as a snapshot each time you run the project.

How it's Done
Backup
  • Create a new project and change the project to a Schema View Project
  • Select your desired database
  • Go to On Completion Tab
  • Add Save Snapshot and define the snapshot filename
  • Switch On Completion to Active
  • Save the project

Now whenever you run this project it will load the schema and save as a snapshot.

Add a new Windows Task Scheduler command to run SQL Delta and add this project to the command line. Now your schema will be saved on a schedule.

Run a schema compare and automatically email the compare report when finished.

How it's Done
Auto Report
  • Create a new project
  • Select your desired source and target database
  • Go to On Completion Tab
  • Add Generate Compare Report and define the report and filename
  • Add Email File and define the email details.
  • When defining the email details select the attachment file and hit add.
  • Switch On Completion to Active
  • Save the project

Now whenever you run this project it will load generate a compare report and email the report.

Add a new Windows Task Scheduler command to run SQL Delta and add this project to the command line. Now your databases will compared and a report emailed on a schedule.

Go to System Preferences to configure the outbound SMTP email server.

We have added a new feature for running SQL Delta using the command line so you can now dynamically change connection information for a project.

To run a project from the SQL Delta command line the standard approach is to pass in the project name. For example sqldelta.exe "My Project" or sqldelta.exe "My Project.xdp"

SQL Delta locates the project within the project manager list, matching against either name or filename and runs the project based on details found. Alternatively the project filename is matched against existing filenames, excluding any path.

Template Projects
Now if a project filename cannot be matched to an existing filename in the project manager list then that project file becomes a template project. Template projects cannot be edited or saved, basically they don't exist in the project manager.

The benefit of template project is the connection details can be dynamically changed via command line switches. Using a batch process multiple databases can be compared using a template project just by changing the command line switches. The limitation of templates is they do not access any filters that may have been persistent to a project.

A template project can still have On Completion events, even load filters and mapping. For data compare projects we recommend using the Automatic mode to allow SQL Delta to automatically load and map the source and target tables each time the project runs which means even dynamic changes to the connection information doesn't limit the data compare.

Important to remember
To create a template project the project filename cannot exist in the SQL Delta project manager. If a project filename is found in the project manager list then any command line connection data switches are ignored. Create the compare project, run it to test to ensure the results are expected. Then copy the project giving it a new name to create your template project. The original source and target connection will be the default connection if connection data switches are not used.

Command Line options: (All case sensitive)

"project name" or "\path\projectfilename.xdp"

/ARun all checked projects found in the Project manager
/LGenerate a log file regardless of project settings. A configured log file will take precedence over this switch
/M:xForce the display to switch to Monitor number x. SQL Delta launches on the last monitor used. In rare cases i that monitor is no longer available SQL Delta may launch off screen. Use this setting to force SQL Delta to launch on a specific monitor.
/QQuiet or Silent mode when the GUI is essentially hidden. SQL Delta will automatically shut down once the project has run and all on completion events have finished
/ROnce a compare completes automatically generate a sync script and deploy. If combined with /L then a log of differences, script errors and after script differences is generated. On completion events take precedence and this switch will be ignored.

Connection Data Switches - Replace the template project content with the following:

/SS="Server Name"Source Server Name e.g. "My Server"
/SU="User Name"Source User name
/SP="!4GFDDGF"Source Password. Normally use the SQL Delta encrypted password which contains an ! at the start otherwise plain text
/SD="Database Name"Source Database e.g. "My Database"
/TS="Server Name"Target Server Name e.g. "My Server"
/TU="User Name"Target User name
/TP="ClearPass"Target Password. Normally use the SQL Delta encrypted password which contains an ! at the start otherwise plain text
/TD="Database Name"Target Database e.g. "My Database"

If more than one template filename is used then each project will have its details overridden by any alternate data. If an On Completion event runs another project then it's details will not be changed by the alternate data.

Filenames
Normally the default folder locations will be used when running a command line project. For example a report will be saved to the reports folder shown in System Settings.

However the CLI project folder will take precedence over the default when running a CLI project from a different location.

If the CLI project folder has reports, script and temp folders then they will be used otherwise the project folder will store any output.

Some On Completion events require a filename and if the filename contains a backslash (\) then that path will override any system defaults. The rules are:

  • If the file name starts with <Drive Letter>:\ or \ then use the path as an absolute path.
  • If the file name contains a \ then extract the path and use it relative to the current project folder.
  • Otherwise save the file to the default location such as script or report.

Finally if a folder does not exist then the current project file location will be used.