Hello all. I am using Sql Compact Edition for a small standalone application, I create and build the initial database schema on initial startup. 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?
Thank you,
Jim
This is something you will have to code yourself, however the key to doing this is to tap into the INFORMATION_SCHEMA views in SQL Compact Edition.
You can get metadata about all aspects of the schema of a SQL CE/SQL Mobile database using this view and then make determinations about old vs new schema as you compare two database versions. Books Online covers the INFORMATION_SCHEMA view and what it contains.
Regards,
Darren Shaffer
No comments:
Post a Comment