Re-wrote SQL patch template as a procedure - so any changes will be rolled back if there is an error anywhere.
SQL script to populate missing index entries