問題描述
在 VS2013 中使用數據庫項目,如果對底層物理數據庫進行了更改(例如,使用 SSMS 添加表),如果您從 VS 進行架構比較,它會檢測到這個新表,但是,從 VS看來您唯一的選擇是忽略此更改,或者在執行 VS 架構比較中的更新時將其刪除.
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.
正確嗎?
推薦答案
不正確,不是很直觀,但是您可以將在物理數據庫中所做的更改導入到您的 VS 項目中.訣竅是在模式比較屏幕中點擊源實體和目標實體之間的切換方向"按鈕,然后重新運行比較 - 然后,您將看到對該差異的操作已從刪除更改為添加,并在執行時更新,該表將添加到您的 VS 數據庫模型中.
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/
這篇關于VS2013 數據庫項目 - 您能否將數據庫本身所做的*更改*導入到您的 VS 項目中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!