views:

41

answers:

2

Does anyone know how to create an entire database from a visual studio database project? Rather then running logs of smaller scripts individually.

Thanks

A: 

In VS express you do the following- It should be similar in the other versions but I don't have them in front of me.

Open Database Explorer (Ctrl-Alt-S)

Right Click "Data Connections" > "Add Connection"

Set 'Data Source' To Microsoft SQL Server Database File

Enter a name for your new Database

Choose your authentication method

It should confirm the creation of the database from there...

In Database Explorer Expand your Database and right click tables > Add new table and so on


It looks like I completely misunderstood the question. If you are trying to generate a script from an existing project for export the Database publishing wizard may do what you need.

http://www.microsoft.com/downloads/details.aspx?FamilyID=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en

apocalypse9
A: 

Are you using vs2008 team edition? If so use the db edition and you can use schema compare to create tables, along with stored procedures, views, etc.

http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed&displaylang=en

The other way I have done is to publish the database, which will create a large sql file for schema and/or data, and then you can execute that in SQL Server Management Suite.

James Black