visual-studio-2012database-projectsql-server-data-toolsdatabase-deployment

Custom script files in VS2012 Sql server project


I am supposed to migrate a database into VS2012 sql server project. I have already imported all the schema from the target database. The seed data will be added to the a Post-Deployment script in the project. However I also foresee lot of scripts being added by developers while working on various enhancements. These can be alter schema scripts as well data add edit delete scripts. And all of them have to run post deployment and in an order, ideally by the script names with 1.0.0.0 executing followed by 1.0.0.2 and then by 1.0.1.0. SQL Server project doesnt allow for multiple post-deployment files. All I can find online is how to create a project while no-one talks about creating a structure which will take into account the changes(alter scripts) made by developers during different release cycles. Can someone please help me here ?


Solution

  • Schema Comparison removes the need to code your own alter scripts. Schema Comparison automatically creates the alter script for you by comparing the database project's schema to your database server.

    Here's a good walk-through of Schema Comparison.