9

Are there way to using data generation plans in VS 2010's database projects to create a set of default data? Or am I barking up the wrong tree i.e. are data generation plans best suited to create dummy example data?

We have a bunch of data (default settings, default users etc etc) that needs to be created for each database deployment. It would be nice to have tooling to help us with this, so it can be source controlled and better managed.

I'm guessing that there are probably third party alternatives, but I'm hoping there is a built-in Visual-Studio-Way of doing things, so it can integrate nicely with TFS etc.

1 Answer 1

9

There are probably different ways to do this, but the basics are to:

  1. create a script that inserts your default data
  2. Edit the Script.PostDeployment.sql script to use your script for inserting the default values

For example, I created a new folder, DefaultData, under the Scripts->Post-Deployment folder of my project and added my script for inserting the default data here, InsertDefaultData.sql. Then, I added the following line to Script.PostDeployment.sql ":r ..\DefaultData\InsertDefaultData.sql".

1
  • Cool thanks, would be awesome to be able to some how visualise the default data (i.e. not in sql, but tabular form or something) using data generation plans or something. I'm not exactly sure what I'm after, but I think scripting is probably the only / best way. Thanks for your help. Aug 19, 2011 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.