We’ve got a product that uses a Microsoft SQL Server database. We’ve got customers using various older versions of the product.
How do people write/structure their database upgrade scripts in this situation?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need a set of release-to-release patch scripts. On production systems with live data this is a bit trickier as you may also have to manipulate data in these scripts.
Redgate SQL Compare Pro is quite a good tool for generating these scripts or doing QA functions on scripts (obviously you shouldn’t really use it for both roles). Because you have live customer data involved you will have to regression test the upgrades.
I don’t think there’s an easy way to do this. You will have to develop the script and test any data manipulations that it does. Do the tests from version to version for some useful set of upgrades. The key here is to arrange a production mirror test environment that you can test the patches in before you apply them to a live system.
P.S. don’t forget to back up and test restore on the production database before you actually finally run the patch script, but you already knew that ;-}