I've a current database (SQL Server 2008 R2), and let me possess a project that may install exactly the same database when i curently have.

i.e the project will browse the schema and also the data, and can have the ability to duplicate the present data and schema. It must save the database information to disk and so i will in a position to install the database on different machines.

Can One get it done with Visual studio 2010 database projects? Could it be an easy task?

(The main reason I'm asking is the fact that I curently have this type of project that installs my database, but it is extremely old(~2000). The old project is a large mess, it's C#, java, sql, batch files plus some third party tools and it has a lot more abilities than I want for my current product..)


Use SQL Server Management Objects (SMO) to produce a snapshot of the source db after which restore it towards the target server.

More about SMO here: http://msdn.microsoft.com/en-us/library/ms162169.aspx . A pleasant tutorial here: http://www.codeproject.com/KB/database/SMO_Tutorial_1.aspx

The simplest strategy is to backup using SQL server management studio. Then slowly move the backup file towards the second server there restore it with SQL server management studio. If you want SQL code to get it done (rather than GUI way), just drop a comment...

This codeplex project includes a fundamental library that does that if you want to roll your personal and it has two sample projects for migration/comparison tasks.


Even the commercial option is by using Sql Redgate's tools. They're costly but worth it if this sounds like a mission critical database. Around the otherhand, if you're simply using a db instead of personal files, say inside a embedded scenario, it may be difficult to justify this kind of costly tool.