English 中文(简体)
SSDTT, 我需要不同的 dacpacs 吗? 如果我需要使用相同的 db 到 SQL Server 2008 和 2012 的 SQL 服务器?
原标题:SSDT, do I need different dacpacs if I need to deploy the same db to SQL Server 2008 and 2012?

在将数据库项目转换为SSDT和升级为SQL服务器(2012年)时,我需要为SQL服务器(2008年和2012年)工作部署脚本。

我使用sqlpackage.exe/Action:Publish 来部署最新的数据库比特。

在 sqlproj 项目属性中, 我确实看到一个 < strong > 目标平台 下调, 有选项 2005/ 2008/ 2012 sql 服务器。 如果我更改此目标平台, 它是否产生不同的 dacpac? 我是否需要为每个 sql 服务器版本携带两个版本的 dacpac?

还是同样的 dacpac 会为任何版本的 sql 服务器工作?

最佳回答

简短的回答是 是 - 不同 SQL 服务器版本的不同 DACP 。 Bob Beuachemin 写了一篇有用的< a href=> http://www.sqlskill.com/BLOGS/BOBB/ 类别/ SQL- Server- 2012.aspx" rel = “ nofollow” >blog posts 关于发援会Fx3. 0 和 DAC 2. 0 的贴文。

问题回答

我知道这是11个月前的事了, 但是在您专门为这个假设进行部署时, 有一种选择, 允许不兼容的平台 。

//Set Deployment Options
DacDeployOptions dacOptions = new DacDeployOptions();
dacOptions.AllowIncompatiblePlatform = true;

在不设定选项的情况下, 我可以将 2008 dac 部署到 sql2012, 但如果我将 2012 dac 部署到 sql2008 时会出错 :

Microsoft.Data.Tools.Schema.Sql.Deployment.DeploymentCompatibilityException: 
A project which specifies SQL Server 2012 as the target platform cannot be published to SQL Server 2008.

设置此选项意味着我无法理解此错误, 并且可以将它应用到以前的版本( 我相信可以追溯到2005年 ) 。 NB 您可能还需要将选项 MatterVerificErrorsAs Warnings 设置为真实 - YMMV 。

在使用 SqlPackage.exe 的命令行中,请使用 p: AllowIncommontiblePlatifor 选项。警告将仍然显示, 但它会继续。 SQL Server 2012 dacpac 的 SQL Sever 2008 R2 运行 。

SqlPackage.exe /Action:Publish 
   /SourceFile:"testdb.dacpac" 
   /TargetDatabaseName:testDb 
   /p:AllowIncompatiblePlatform=true
   /TargetServerName:"testserver"




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

难以执行 REGEXP_SUBSTR

I m 查询Oracle 10g。 我有两张表格(样本数据见下文)。 i m 试图提取一些领域

SQL Query Shortcuts

What are some cool SQL shorthands that you know of? For example, something I learned today is you can specify to group by an index: SELECT col1, col2 FROM table GROUP BY 2 This will group by col2

PHP array callback functions for cleaning output

I have an array of output from a database. I am wondering what the cleanest way to filter the values is example array Array ( [0] => Array ( [title] => title 1 ...

OracleParameter and DBNull.Value

we have a table in an Oracle Database which contains a column with the type Char(3 Byte). Now we use a parameterized sql to select some rows with a DBNull.Value and it doesn t work: OracleCommand ...

Running numbers in SQL

I have a SQL-statement like this: SELECT name FROM users WHERE deleted = 0; How can i create a result set with a running number in the first row? So the result would look like this: 1 Name_1 2 ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签