Actually, this is the best way. As cumbersome as it may seem, this is better than alternatives to using SQL Compare similar tools or VSDB. I have argued several times that the smae approach exists: Version control and your database . My applications deploy the v1 schema from the initial script, and then run the script update for each version. Each script knows how to upgrade version N-1 to N, and only that. The end result is the current version.
The biggest drawback is the lack of an authoritative .sql file to find the current version of any object (procedure, table, view, etc.). But the benefits of being able to deploy your application over any previous version and the benefits of deploying with well-controlled and tested scripts far outweigh the disadvantage.
If you feel bad about using this deployment process (script to deploy v1, then apply v1.1, then v1.2 ... until finally you apply v4.5, current) then keep this in mind: the exact same process used by SQL Server to update the database between releases. When you attach an older database, you see that in the famous "database is upgrading from version 611 to 612", and you see that the update is in stages, it is not updated directly to the current version 651 (or whatever your case). In addition, the update does not launch the diff tool to deploy v 651 compared to version 611. This is because the best approach is the one you are just using, update one step at a time.
And to add a real answer to your question, after the publication of a rather oblique statement (there is a topic on which I have strong opinions, can you say?): I consider it valuable to have a script of the current version, but I think it should be continuous integration building process. In other words, your build server should create the current database (using update scripts), and then, as a build step, the script exit the database and shorten the build with the current version of the script schema. But they should be used only as reference information for searching and verifying the code, and not as for delivery, my 2C.
Remus Rusanu
source share