VS 2010 Database Project: Adding Tables
Posted
Sun, May 2 2010 22:43
by
Deborah Kurata
The new Visual Studio 2010 Database Project, as described in this prior post, makes it easy to work with scripts for an existing database or build new scripts directly within Visual Studio. This post details how to add table scripts to a Database project
Start by adding a VS 2010 Database project to your solution following the steps in this prior post. Then follow the steps below to add tables to your project.
1. Right click on the Tables node for the Database project in Solution Explorer.
2. Select Add | Table.
This opens the Add New Item dialog:
3. Enter the name of the new table and click the Add button.
The table script template then appears in the code editor and you can enter the information for the table.
Notice that there is no visual editor available here as there is in Server Explorer. But if you know SQL, it is quick to enter the columns in the table.
When you are ready to apply the table script to your development database, you can deploy the script as detailed in this post.
Use this technique any time you want to add a table script to your project.
Enjoy!