Вопрос

I'm pretty new to the whole VS2010 DB Project game. Essentially I've been designing the database using the SQL Server Manager and my team decided that we wanted to use a DB project in VS2010 so we can manage the SQL in SVN.

So, my question is -- what's the best way to move the entire schema (data itself is not needed at this point) to a DB project in VS2010 so we can leverage the rich VS2010 DB-building features going forward? Is it as simple as just exporting the SQL/script? Should I export the schema as a DAC and use a VS DAC project instead? I'm not really finding anything particularly useful to explain the advantages/disadvantages of using a DB project vs. a DAC project.

Thanks in advance for your help! Any words of advice are appreciated.

Это было полезно?

Решение

Well, basically, you'd start a new Visual Studio 2010 Database Project (File > New Project > Database > SQL Server 2008 Database Project).

When you have that project, right-click on the project main node, pick Import Database Objects and Settings and point it at your existing database.

This will import all objects from your database as SQL scripts. This can be stuck into source control.

Now, at this point, you'd just edit the CREATE ...... scripts as needed - and when you deploy, the VS DB project will compare your set of CREATE scripts against the existing target database, and figure out the DIFF SQL script, and create that - optionally, you can also execute it right away, against your target database (I typically don't do that).

I haven't really investigated the DAC projects too much just yet - typically, the first version of anything is pretty rocky to use, so I'll happily wait for VS 2012 and DAC 2.0 before I pour too much time into it :-)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top