Facing errors while SQL deployment in azure devops pipeline

点点圈 提交于 2020-06-01 06:07:25

问题


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)

回答1:


Agree with Michael's appointment.

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

and

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.


  • The first solution is set /p:BlockOnPossibleDataLoss=false.

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

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


  • The second solution is input /p:TreatVerificationErrorsAsWarnings=true

Note: The second solution should be used if the first one does not work for you.

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.


See this doc to get more publish action.



来源:https://stackoverflow.com/questions/58690504/facing-errors-while-sql-deployment-in-azure-devops-pipeline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!