x
login about faq Site discussion (meta-askssc)

How to add objects to existing VS2010 database project

We have a database project in Visual Studio 2010. On our development server, I have created a couple of new tables (with some indexes, foreign keys, etc).

How do I import this new table and associated indexes, keys etc into my database project?

more ▼

asked Feb 10 '11 at 01:23 AM in Default

xnl28 gravatar image

xnl28
765 45 49 56

(comments are locked)
10|1200 characters needed characters left

2 answers: sort oldest

I am not too sure about VS2010 with regard to reading objects out the database, or how you have your project setup, but I have written a Powershell script to read out the objects of a database for use with source control. It spits out a file for each object, you would then only need to create the table files using the SMO calls in my script.

You can find the script here: Scripting DB Objects using Powershell

more ▼

answered Feb 10 '11 at 01:58 AM

WilliamD gravatar image

WilliamD
25.3k 16 18 41

An excellent script! Thanks

Feb 10 '11 at 02:19 AM xnl28
(comments are locked)
10|1200 characters needed characters left

Visual Studio 2010 has the ability to compare a database with the project. It's in the Data menu and the Schema Comparison option. After that it should be fairly self-explanatory.

more ▼

answered Feb 10 '11 at 04:57 AM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
61.5k 12 19 66

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x209
x14
x1

asked: Feb 10 '11 at 01:23 AM

Seen: 1144 times

Last Updated: Feb 10 '11 at 01:31 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.