在Azure Devops管道中进行SQL部署时面临错误 [英] Facing errors while SQL deployment in azure devops pipeline

查看:173
本文介绍了在Azure Devops管道中进行SQL部署时面临错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Am在azure devops的发布管道中使用sql DACPAC类型的部署,但出现以下错误.我对SQL一无所知,有什么建议吗?

Am using sql DACPAC type of deployment in release pipeline of azure devops.but getting below error. I have no idea about SQL.Any suggestions?

Publishing to database 'database_name' on server 'Server_name'. 
Initializing deployment (Start) 
*** The column [dbo].[xxxx].[yyyy] is being dropped, data loss could 
occur. 
Initializing deployment (Complete) 
Analyzing deployment plan (Start) 
*** If this deployment is executed, changes to [dbo].[xxx2] might 
introduce run-time errors in [dbo].[yyyy2]. 
Analyzing deployment plan (Complete) 
Updating database (Start) 
An error occurred while the batch was being executed. 
Updating database (Failed)

推荐答案

同意迈克尔的任命.

[***]列被删除,可能会发生数据丢失.

The column [***] is being dropped, data loss could occur.

如果执行了此部署,则可能会引入对[]的更改 []中的运行时错误.

If this deployment is executed, changes to [] might introduce run-time errors in [].

所有这些都是由于违反安全性造成的.我假设您对数据库做了一些更改,这些更改无法确定它是否会破坏目标数据库上的任何内容.现在,由于服务器无法确定更改是否安全,因此它将阻止部署.

These are all expected which caused by against the security. I assume you did some changes into your database which can not sure whether it would break anything on target database. Now, it will block the deployment since the server can't determine whether the changes are secure.

  • 第一个解决方案设置为/p:BlockOnPossibleDataLoss=false.
  • The first solution is set /p:BlockOnPossibleDataLoss=false.

BlockOnPossibleDataLoss的默认值为true,这意味着如果检测到可能的数据丢失,请停止部署.然后false SqlPackage.exe 忽略它们.

The BlockOnPossibleDataLoss default value is true, which means stop the deployment if possible data loss detected. And false let SqlPackage.exe ignore them.

因此,请执行任务,然后定位至并将以上参数输入附加SqlPackage.exe参数:

So, please go the task, then locate to and input the above argument into Additional SqlPackage.exe Arguments:

    输入
  • 第二个解决方案 /p:TreatVerificationErrorsAsWarnings=true
  • The second solution is input /p:TreatVerificationErrorsAsWarnings=true

注意: 如果第一个解决方案不适合您,则应使用第二个解决方案.

设置TreatVerificationErrorsAsWarnings=true意味着将验证错误视为警告,以获取完整的问题列表,并且可以绕过允许在第一个错误发生时停止发布操作的限制.

Set TreatVerificationErrorsAsWarnings=true means treating the verification errors as warnings to get a complete list of issues, and it can bypass the limitation of allowing the publish action to stop when the first error occurs.

请参见 doc 以获得更多的发布操作.

See this doc to get more publish action.

这篇关于在Azure Devops管道中进行SQL部署时面临错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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