Import data tier application is failing

Deadly 提交于 2020-01-04 09:29:08

问题


I'm getting the following error while restoring the database backup (.bacpac file) into my on premise SQL Server 2016 instance.

TITLE: Microsoft SQL Server Management Studio

Could not import package.

Warning SQL72012: The object [Azure_Data] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.

Warning SQL72012: The object [Azure_Log] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box.

Error SQL72014: .Net SqlClient Data Provider:

Msg 33161, Level 15, State 1, Line 1
Database master keys without password are not supported in this version of SQL Server.

Error SQL72045: Script execution error. The executed script: CREATE MASTER KEY;


回答1:


This is due to a difference between SQL Azure and SQL Server 2016. Having a master key without a password is an Azure-only feature. There are two ways to address this issue.

1) open the .bacpac and remove the master key object as well as the credential object. (Rename the .bacpac to .zip, unzip and then look through the xml files, make necessary changes, zip back up and rename back to .bacpac)

or

2) add password encryption to the master key before you export the database to a .bacpac using the following: ALTER MASTER KEY ADD ENCRYPTION BY PASSWORD = '<PasswordHere>';




回答2:


There a much easier solution now. Download an update for SSMS... at least version 14.0.17277.0. That way you don't have to play around with master keys or patching bacpac files. It's much much easier.



来源:https://stackoverflow.com/questions/47616989/import-data-tier-application-is-failing

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