简体   繁体   中英

Creating upgrade patch for database installer using visual studio

I have used visual studio(vs2010) installer to restore a database backup file to the target server.

Now my requirement is to create a patch that will update the database if required.These updates may be in form of addition of scripts etc.

If i will again take the updated .bak file and restore it on target server through installer,the existing data will be lost that client is using.

So i just want to create a patch which will install the newer changes only, say addition of new table in the database.

Please suggest way to do it.

Regards,

Shipra

  1. Somewhere in your database, store a version number.
  2. When your program is run, check the version number in the database.
  3. If the version number is not sufficient (eg version 3.0 is found but 3.1 is required), execute the SQL commands that update the database to the required version (eg CREATE TABLE , ALTER TABLE , ...)

That way, all you need to do is update your program. Yes, this means that you have to keep track of changes to your database schema. (Note that this solution requires that the user running the program has schema modification rights to the database.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM