Database Schema Comparison

95se5m

Member
Joined
Nov 29, 2004
Messages
21
Location
NE Pennsylvania
Programming Experience
3-5
Hello all. I am using Sql Compact Edition for a small standalone application, I create and build the initial database schema on the initial startup of the application. What I am looking for is a way to upgrade the software and on initial startup of the new version, I would like it to compare the existing database with a new schema and then update the database based on the difference. This way I can have a version that will update the database without me having to know what version it is to begin with. Is there a way to do this or am I asking too much? :confused:

Thank you,

Jim
 
We did something almost like this for an app that used MSDE. For each patch we deployed we just included a scripts.sql text file with all the sql statements that would update the client database.

The client app updater would execute these scripts and your database would be up to date.

However, you want to send the new schema down to the client app and compare it to the client database, then generate all the necessary changes to be applied.

Our clients would always have to update all patches in order so that no update scripts were missed, which means they may have to apply 5 patches if they haven't updated in awhile. So, the way you want to do it may be better but, if you plan the method we used out correctly it will work just fine.

Either way you're going to have to know how to write the update scritps that are going to be applied to the client database since I don't think there's an automatic way to compare the schemas and generate the scripts, then run them. But who knows, you may get lucky and find a way to do it.

Good luck,
CT
 
Back
Top