VS2013 Database Project - Can you import *changes*

2019-08-27 04:32发布

Working with a Database Project in VS2013, if changes are made to the underlying physical database (say, add a table using SSMS), if you do a schema compare from VS, it detects this new table, however, from the VS side it seems your only option is to either ignore this change, or delete it when you execute the Update in VS Schema Compare.

Is that correct?

2条回答
男人必须洒脱
2楼-- · 2019-08-27 05:01

Incorrect, it's not very intuitive, but you can import changes made in the physical database into your VS project. The trick is to hit the "switch direction" button between your source and target entities in the Schema Compare screen and rerun the Compare - then, you will see the action on that difference has changed from a Delete to an Add, and when you execute the Update, the table will be added to your VS database model.

Some more detailed notes can be seen in this blog post:

http://sanderstechnology.com/2013/schema-modelling-with-visual-studio-2013-preview/12336/

查看更多
叼着烟拽天下
3楼-- · 2019-08-27 05:04

SSDT Database Projects aren't designed to easily accommodate changes made to the database and pulled back to the project. It encourages you to do the reverse and update the project first, which isn't the way most database developers currently work.

If you're going to regularly do "connected" development, it might be worth trying out a tool designed for that development methodology, such as ReadyRoll, as this has a built-in mechanism to sync to the project from the database.

If you're making changes directly to the database infrequently, you're probably better off using the Schema Compare feature as you are now.

查看更多
登录 后发表回答