How do I deploy Metadata during my database deploy

Problem:

I need to deploy Metadata with my database deploy.

Solution:

Add a script to perform the inserts of the metadata to the post deployment phase of a database deploy.

Explanation:

Metadata is data that must exist in your database for your application to execute.  I took a short cut using the Data Compare feature of Visual Studio to create the metadata script.  I deployed my database project to a new empty database. I then preformed a data compare from a database that had the desired data in it to my empty database and saved the resulting sql file as metadata.sql.  Now we simply need to have this file called during the post deployment phase of a database deploy.  I added the metadata.sql file to the Post-Deployment folder under scripts in my database project.  Then I opened Script.PostDeployment.sql and added the following line
:r .\MetaData.sql

Pingbacks and trackbacks (1)+

Comments are closed