发布配置文件中的Visual Studio数据库项目目标平台 [英] Visual Studio Database project target platform in publish profile

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

问题描述

是否可以在发布配置文件中指定目标平台(SQL Server 2014,SQL Server 2016,Azure等)?我有一个数据库项目,有时会部署到本地SQL Server 2016实例,而其他时候则部署到Azure SQL数据库.我只想指定2个不同的发布配置文件,并在那时即时更改目标平台.这可能吗?

Is it possible for me to specify the Target Platform (SQL Server 2014, SQL Server 2016, Azure, etc) in a publish profile? I have a database project that I sometimes deploy to a local SQL Server 2016 instance, and other times deploy to an Azure SQL database. I would like to just specify 2 different publish profiles and have the target platform be changed on the fly at that time. Is this possible?

推荐答案

Azure,MSSQL 2014和MSSQL 2016对数据库项目有不同的限制和要求.

Azure, MSSQL 2014, MSSQL 2016 have different limitations and requirements to Database Project.

让我们想象一下: 您正在MSSQL 2014中使用FILESTREAM,并将在MSSQL 2016中使用.数据库项目中描述了您的FILESTREAM.现在,您在解决方案中添加了Azure支持,并希望部署数据库.但是,Azure 不支持文件流.

Let's imagine: You are using FILESTREAM in MSSQL 2014 and will use in MSSQL 2016. And your FILESTREAM is described in Database Project. Now, you add Azure support in your solution and want to deploy database. But, Azure does not support FILESTREAM.

因此,在这种情况下,您不能拥有一个数据库项目.您需要选择支持的最小目标项目:

So you can't have one database project in this case. You need to select minimal supported target project:

在这种情况下,它是Microsoft Azure SQL数据库(或V12).选择最低支持的目标平台后,可以确定所有更高"版本都将支持它.

In this case, it's Microsoft Azure SQL Databse (or V12). When you select minimal supported target platform, you can be sure that all "higher" versions will support it.

假设,Azure是MSSQL Server功能的某些子集.然后Database Project会在目标平台上验证所有使用的功能.

Assume, that Azure is some subset of MSSQL Server features. And Database Project validates all using features across target platform.

如果您担心选择Microsoft Azure SQL Databse作为目标平台,则无法发布到MSSQL Server 2016-没问题,它将起作用.

If you afraid that selecting Microsoft Azure SQL Databse as target platform you won't able to publish to MSSQL Server 2016 - no problem, it will work.

如果您需要使用其他连接字符串或发布设置,请创建其他发布配置文件.

If you need to use different connection strings or publish settings - create different publish profiles.

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

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