I need to implement upgrade database
I have in the codebase code the works with redgate and know how to generate compare data and schema
This works fine, but my manager told me he think it’s better to generate the delta script once in the office, and save the version of the database inside the database, and when update occurs in the field there will switch statment from version a to b run particular script
He said it is more definsive approch, because he don’t know what the script will generate in run time,
We have a medical program, so we can’t afford to update the database with the wrong data
Is his approch is familiar to you? would you recommand it?
Dan
I’m the product manager for SQL Compare at Red Gate. SQL Compare will produce a reliable script in the vast majority of circumstances. However, you should never apply the changes to a production environment without first having:
1) Restored a recent backup as a Staging environment and applied the script as a test
2) Backed up Production prior to running the script.
Saving the version in the production target is a sound idea, as it allows you to interrogate this before applying a script which is generated elsewhere. However, it’s no guarantee that the target server is the one it claims to be. This is called ‘drift’ where ad-hoc changes could have been made to a database without the version number being updated.
Red Gate has developed its own versioning mechanism that stamps the target database with the revision of the database as held in source control. You can read more about how this works here:
http://www.red-gate.com/supportcenter/content/SQL_Source_Control/help/3.0/SSC_Working_With_Migrations
We’re working to evolve and continuously improve how databases are deployed so do let us know if you have any feedback.