Deborah's Developer MindScape






         Tips and Techniques for Web and .NET developers.

May 3, 2010

VS 2010 Database Project: Adding Tables

Filed under: C#,VB.NET,Visual Studio @ 12:43 am

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.

image

2. Select Add | Table.

This opens the Add New Item dialog:

image

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.

image

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!

RSS feed for comments on this post. TrackBack URI

Leave a comment

© 2021 Deborah's Developer MindScape   Provided by WPMU DEV -The WordPress Experts   Hosted by Microsoft MVPs