3 sql sql-server sqlcmd dacpac azure-devops
我在 azure devops 的发布管道中使用 sql DACPAC 类型的部署。但出现以下错误。我对 SQL 不了解。有什么建议吗?
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)
Run Code Online (Sandbox Code Playgroud)
同意迈克尔的任命。
列 [***] 正在被删除,可能会发生数据丢失。
和
如果执行此部署,对 [ ] 的更改可能会在 [ ]中引入运行时错误。
这些都是因危害安全而造成的。我假设您对数据库做了一些更改,但无法确定它是否会破坏目标数据库上的任何内容。现在,它将阻止部署,因为服务器无法确定更改是否安全。
/p:BlockOnPossibleDataLoss=false
。默认BlockOnPossibleDataLoss
值为true
,这意味着如果检测到可能的数据丢失,则停止部署。并false
让SqlPackage.exe忽略它们。
因此,请转到该任务,然后找到并将上述参数输入到“Additional SqlPackage.exe Arguments”中:
/p:TreatVerificationErrorsAsWarnings=true
注意: 如果第一个解决方案不适合您,则应使用第二个解决方案。
设置TreatVerificationErrorsAsWarnings=true
意味着将验证错误视为警告以获取完整的问题列表,并且它可以绕过允许发布操作在发生第一个错误时停止的限制。
请参阅此文档以获取更多发布操作。
归档时间: |
|
查看次数: |
6281 次 |
最近记录: |