Create Snapshot Table

Follow these steps in order to create the snapshot table:
  1. Drop snapshot table, nextSnapshotId table, and getNextSnapshotId proc.
  2. Create and populate nextSnapshotId table; create snapshot table, index and primary key
  3. Create 1st foreign key
  4. Create 2nd foreign key
  5. Create 3rd foreign key
  6. Create 4th foreign key
  7. Create 5th foreign key
  8. Create 6th foreign key
  9. Create getNextSnapshotId stored procedure

Drop procedure