For my application, I have to support update scripts and the database may be affected.
I want to be able to upgrade an old version to the latest version without installing intermediate versions. For example. Suppose I have version A (oldest), B (intermediate), and C (new version). I want to be able to upgrade version A directly to version C. For application files, it's easy, I just replace the old with the new ones. However, for the database, I do not want to generate SQL Script to change the database schema from A directly to C, instead I want to first apply Script to change the schema from A to B and from B to C.
How to save database version for SQL Server database? Is there any special property that I can set, instead of embedding a version table? In my (.NET) code, I want to read the database version and, accordingly, execute the SQL update scripts in the correct order.
I will use SQL Server 2005 and SQL Server 2008.
source
share