Temporal (versioned) Tables - SQL Server 2016 onwards

The DB Ghost Script, Build, Compare and Upgrade processes now manage the syntax of versioned tables and their history tables.

For upgrade when a versioned table needs to be rebuilt to a new schema, first DB Ghost detaches and renames the history table, then recreates the new table schema and populates it from the old table's data. Next DB Ghost leverages SQL server to automatically create a new history table with, matching new schema, by flipping versioning on and off again. Then the new history table is populated from the old history table's data. Finally switching on versioning again ready for normal system operation.

In this way your history data is preserved and even your history table's special rowstart/end column names are preserved. It is also smart enough to handle an upgrade that needs to change the name of a rowstart/end column in your history table. Any custom indexes on the source history table are also compared and upgraded to the target. This saves you a whole lot of manual scripting around this feature of SQL Server.

Sequence Objects

SO's are now fully supported in script, build, compare and sync.

Where an SO is missing from the target database sync will create it and set its next value to match that of the source database. Where an extra SO is found in the target database sync will drop it. Where SO's are different compare will show all differences in type, precision, increment, max/min value, cycle and cache, as well as differences in start value and current value.

To sync an SO; if the difference is only within these properties (increment,minvalue,maxvalue,cycle,cache) then sync will ALTER it. If the difference is the type then sync will DROP and re-CREATE it, and restore its current value as it was before.

NB. If the difference is only in the current value or start value, sync will ignore this and leave it to a custom script where the user implements specific business logic if they need to sync the SO values. Reasoning; a common use of SO to generate PK values, so changing the next value would often be a bad idea because of the likelihood of creating duplicate keys.

Partial Schema Upgrades

When comparing and upgrading you can now control which objects are considered not only by object types but also using a filter to match individual objects names.


Azure and 2012 Support programme

With version we are supporting users working with Azure or SQL Server 2012.

Splice and dice static data

When comparing and upgrading data you can now control which tables, rows and even which columns are used in the process.

  • Tables can be picked individually or automatically
  • Choose to compare all columns or individually select from the source columns
  • Rows can be filtered by adding statements for a where clause