开发者

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 wil开发者_C百科l 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 (e.g. version 3.0 is found but 3.1 is required), execute the SQL commands that update the database to the required version (e.g. 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.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜