databasevisual-studiotfsvsdbcmd

Deploy content from a database-project to other database


I have a build-definition in TFS that builds a database-project in Visual Studio. The output is a dbschema and some other files. With that dbschema I deploy that Database to another server by using vsdbcmd. This works fine to deploy the Database structure/schema.

Is it possible to also deploy the data/content of the original database to the other database? Or also put the db-content in the output from the build-definition?

Thanks


Solution

  • You can include INSERT statements in the PostDeploy sql script within the DB Project to generate any data you need.

    If you want to generate these INSERT statements en-masse you can use the Data Compare tool to compare a DB with data to one without, and it will gen all the INSERT statements you need that you can then copy-paste into the PostDeployment script.