How to make a restore point to restore a database?

Sometimes you want to test a manual created SQL-script (on a dev- or testserver!) without the risk of corrupting the database or without going trough the steps of a complete database copy + restore as described here: DTAP Best practice, database copy tool

An example of a use case for this is when you are correcting columns/sorts/filters in the useroverviewsettings table after a field/function is changed with an update. This to ensure that the user that has this field or function in an overview does not get an error.

As simple way of useing a restore point is to:

  1. send an update of type data only but without adding any dataset
  2. in the installer choose to make a backup of the database
  3. don’t keep the update yet as that will delete the backup again
  4. test your manual scripts by running them in your database editor application (i.e. SSMS).
  5. if you want to restore the backup in case of a wrong script, simply choose to not keep the update in the installer. The database backup will be restored.
2 Likes