如何在 VS 2015 中发布 Visual Studio 数据库项目 [英] How to Publish Visual Studio Database Project in VS 2015

查看:145
本文介绍了如何在 VS 2015 中发布 Visual Studio 数据库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法用谷歌搜索这个.

I was unable to google this.

我们有一个现有的数据库项目(sql server).

We have an existing database project (sql server).

添加了一些新文件(脚本).

Some new files (scripts) were added.

我们有一个现有的服务器/数据库,需要在该上下文中运行一些新脚本.

We have an existing server / database where some new scripts need to be run into that context.

在 Visual Studio 2015 中,我怎样才能做到这一点?

In Visual Studio 2015, how can I accomplish this?

我被告知要留在 Visual Studio 2015 中.理想情况下,我想为每个单独的脚本发出一个命令而不是一个命令.

I was told to stay inside Visual Studio 2015. Ideally, I'd like to issue one command vs one for each individual script.

推荐答案

您有几个选择.

  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.

这篇关于如何在 VS 2015 中发布 Visual Studio 数据库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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