Emad GabrielThoughts, tips and shortcuts about building software
Tips

Generating Script to reproduce Database Schema AND data

Many times we need a script that reproduces a database schema along with some data; example: lookup tables values.

Turned out it can be done quite easily with the Publishing wizard that is a standard part of the Visual studio 2008.

All you need to do is open the database in the server explorer, right click on the database and select “Publish to provider”.

Screen shot

PublishDB

DatabasepublishingScriptsVisual Studio