Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-Importing/Updating a SQL Server database project after I modify the DB in Mgmt Studio

Tags:

My team is working with a .NET 2008 DB Project in their solution so we have some way to persist the schema between machines and through development and keep things consistent.

My preferred way of changing the database and keeping track of said schema is through the SQL Server Mangement Studio -- basically, I have a copy of the deployed DB project and make my schema changes to that so there isn't a chance of corrupting my personal development environment. However, when I'd like to move my changes to the codebase, I'm having to add the files manually which I feel might be unnecessarily time consuming (boy am I spoiled!).

My question is -- is there a way I can re-import my altered schema to the DB project without having to remove the project entirely from the solution, and re-adding it by hand?

I feel like I'm missing some really simple step. Help?

like image 697
Bryan A Avatar asked Jun 29 '11 19:06

Bryan A


People also ask

How do you update a database project?

To update your projects's schema you can use "Schema compare" feature from Data menu. Choose your development database as Source, your database project as Target and get schema comparasion as result. It will find what you have changed since project creating and will show you diffs for tables and other database objects.

How do you connect database and projects?

In the SQL Connect window, click Create from an existing database project. The Create from an existing database project dialog box is displayed: Click Browse and specify the location of your database project or folder. For SQL Server Database Projects, this is the folder containing the project file.


1 Answers

To update your projects's schema you can use "Schema compare" feature from Data menu. Choose your development database as Source, your database project as Target and get schema comparasion as result. It will find what you have changed since project creating and will show you diffs for tables and other database objects. So you will be able to look through these changes and skip some of them if you like. Then click "Write updates" and your changes are added to the project.

like image 198
Alina Avatar answered Sep 21 '22 13:09

Alina