How do I deploy Metadata during my database deploy

by Donovan Brown 6. September 2010 19:43

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

Tags: ,

Work

Pingbacks and trackbacks (1)+

About the author

My name is Donovan Brown and I am a Technology Specialist for DevTools with Microsoft with a background in application development.  I also run one of the Nation’s fastest growing online registration sites for motorsports events DLBRacing.com.  When I am not writing software I race cars for fun.  DLBRacing.com has given me the opportunity to combine my two passions writing software and racing cars.

AdSense

Month List

AdSense