在Mgmt Studio中修改数据库后,重新导入/更新SQL Server数据库项目 [英] Re-Importing/Updating a SQL Server database project after I modify the DB in Mgmt Studio

查看:44
本文介绍了在Mgmt Studio中修改数据库后,重新导入/更新SQL Server数据库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队正在其解决方案中使用.NET 2008数据库项目,因此我们有某种方法可以在机器之间以及通过开发来保持架构,并使事情保持一致.

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.

更改数据库并跟踪所述模式的首选方式是通过SQL Server Mangement Studio-基本上,我有一个已部署的DB项目的副本,并对该模式进行了更改,因此没有机会破坏我的个人发展环境.但是,当我想将更改移至代码库时,我不得不手动添加文件,这可能会不必要地浪费时间(我被宠坏了!).

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!).

我的问题是-有没有一种方法可以将更改后的架构重新导入到DB项目中,而不必完全从解决方案中删除该项目,然后手动添加它?

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?

推荐答案

要更新项目的架构,可以使用数据"菜单中的架构比较"功能.选择开发数据库作为源,选择数据库项目作为目标,并获得模式比较.它会找到您自项目创建以来所做的更改,并向您显示表和其他数据库对象的差异.因此,您可以查看这些更改,并根据需要跳过其中的一些更改.然后单击写更新",您的更改将添加到项目中.

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.

这篇关于在Mgmt Studio中修改数据库后,重新导入/更新SQL Server数据库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆