且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 VS 2015 中发布 Visual Studio 数据库项目

更新时间:2022-12-31 10:50:20

您有几个选择.

  1. 发布选项.这是将 db 项目中的内容完全自动化地部署到目标服务器.通过右键单击您的项目并选择发布来执行此操作.此选项可用于执行增量部署(仅部署更改),也可用于清除数据库,然后完全部署 db 项目,因此请在执行发布前检查所有选项.
  2. 架构比较.架构比较执行 db 项目与目标数据库的比较,显示差异,并让您选择要部署的差异.您可以通过向数据库项目添加新的架构比较文件来执行架构比较.
  1. The Publish option. This is a totally automated deployment of what's in the db project to the target server. Do this by right-clicking your project and selecting Publish. This option can be used to perform an incremental deployment (only the changes are deployed) or can be used to wipe a database clean followed by a full deployment of the db project, so check all options before performing publishing.
  2. Schema Comparisons. Schema comparisons perform a comparison of the db project to the target database, shows you the differences, and lets you select which differences to deploy. You can perform a schema comparison by adding a new Schema Compare file to your database project.

简而言之,发布选项允许自动暴力部署,而架构比较通过让您选择部署哪些更改来提供更大的灵活性,但架构比较无法自动化.

In short, the publish option allows automated brute force deployments, whereas schema comparisons provide more flexibility by letting you choose which changes to deploy, but schema comparisons cannot be automated.