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

1

28

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?

Climacteric answered 29/6, 2011 at 19:4 Comment(0)
S
53

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.

Sade answered 15/7, 2011 at 10:18 Comment(3)
Wondering how I could miss large swap-arrows :)Vincentvincenta
Urgh, that's so obvious once you read your answer!! Thank you!Hillhouse
Question is about how to reload the same database.. reimport the same database.. answer got 53 likes... ?!Mitrailleuse

© 2022 - 2024 — McMap. All rights reserved.