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

时光总嘲笑我的痴心妄想 提交于 2019-12-03 12:05:55

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/6525861/re-importing-updating-a-sql-server-database-project-after-i-modify-the-db-in-mgm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!