简体   繁体   English

从包含加密对象的数据库中导出带有数据(bacpac)的数据层应用程序

[英]Export Data-Tier Application with Data (bacpac) from a database that contains encrypted objects

I have a SQL Server 2012 Database project that I have been working on for deployment of our database. 我有一个正在部署数据库的SQL Server 2012数据库项目。 The dacpac deployments are working great but I have run into a roadblock when it comes to deploying data along with the schema. dacpac部署工作得很好,但是在与模式一起部署数据时遇到了障碍。

My plan was to have a local copy of the database that contains all of the default data so that I could deploy the dacpac to that database then export a bacpac that contains the latest schema as well as the default data set for deployment to remote sites. 我的计划是拥有包含所有默认数据的数据库的本地副本,以便我可以将dacpac部署到该数据库,然后导出包含最新架构以及默认数据集的bacpac以便部署到远程站点。

However, we have a handful of objects in the database that are encrypted and the bacpac export fails on those objects. 但是,数据库中只有少数几个对象已加密,而bacpac导出对这些对象失败。 Is there a way to export a bacpac from a database that contains encrypted objects or how might you recommend addressing this issue? 有没有一种方法可以从包含加密对象的数据库中导出bacpac,或者建议如何解决此问题?

Edit: I am also running into issues with objects that reference system databases such as Master and MSDB if you have any suggestions for that. 编辑:如果您对此有任何建议,我还会遇到引用系统数据库(例如Master和MSDB)的对象的问题。

I think that export encrypted object as data-tier application is not possible for now. 我认为暂时无法将加密对象导出为数据层应用程序。

As for system databases references you need to go to the Solution->Project->Reference->Add Database Reference (see screenshot below) 对于系统数据库参考,您需要转到解决方案->项目->参考->添加数据库参考 (请参见下面的屏幕截图)

在此处输入图片说明

and add reference to the system database msdb (or master). 并添加对系统数据库msdb(或master)的引用。

在此处输入图片说明

Thanks for this question. 谢谢这个问题。 I have the same issue, though three days ago, I was exporting encrypted objects without an issue locally and now I'm running into this error. 我遇到了同样的问题,尽管三天前,我在本地导出加密对象而没有问题,现在却遇到了此错误。

My work-around has been to create a copy of the database, drop the encrypted objects of the database copy, then export that (I need the data). 我的解决方法是创建数据库副本,删除数据库副本的加密对象,然后导出该副本(我需要数据)。 However, I do not know of a work-around to extract all the objects, including the encrypted objects. 但是,我不知道一种提取所有对象(包括加密对象)的解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM