Search code examples
data-migrationsql-server-data-tools

Incorporate data migrations with SSDT publish?


Is there a systematic way to incorporate data migration scripts with an SSDT publish?

For instance, deploying a new feature that requires a new permission be added to the database in the form of a series of inserts.

I know I can just edit the generated publish script, but if the script needs to be regenerated you have to remember to re-add the data migration scripts.


Solution

  • The recommended practice is to use a post-deployment script. This blog post describes the approach further:

    http://blogs.msdn.com/b/ssdt/archive/2012/02/02/including-data-in-an-sql-server-database-project.aspx