如何在不使用VerifyExtraction的情况下将MSSQLServer数据库提取为.dacpac? [英] How to extract MSSQLServer database as .dacpac without VerifyExtraction?

查看:173
本文介绍了如何在不使用VerifyExtraction的情况下将MSSQLServer数据库提取为.dacpac?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Server Management Studio提取MSSQLServer数据库的数据库架构.我使用提取命令提取数据层应用程序".

I want to extract a database schema of a MSSQLServer database with Server Management Studio. I use the Extract command "Extract Data-tier Application.."

在数据库中有对另一个数据库的多个引用.因此,我收到以下错误.

In the database are several references to another database. Because of this I get the following error.

提取数据库时出错:验证数据包的模式模型失败. 错误SQL71562:验证元素[dbo].[x]时有对对象[dbo].[y]的未解析引用.从此平台创建软件包时,不支持外部引用.

Error extracting database: Validation of the schema model for data package failed. Error SQL71562: Error validating element [dbo].[x] has an unresolved reference to object [dbo].[y]. External references are not supported when creating a package from this platform.

问题是,SSMS使用带参数 /p:VerifyExtraction = True 的SQLPackage.exe.当我使用控制台并在不使用此参数的情况下调用SQLPackage.exe时,默认情况下它将使用 /p:VerifyExtraction = False ,并且我可以创建.dacpac文件.

The problem is, that SSMS uses the SQLPackage.exe with parameter /p:VerifyExtraction=True. When I use the console and call SQLPackage.exe without this Parameter, it uses /p:VerifyExtraction=False by default and I can create the .dacpac file.

是否可以将SSMS配置为禁用验证?

Is there a way to configure SSMS to disable verification?

推荐答案

我也找不到能在SSMS(2008 R2或2012)中工作的方法,但是带有SSDT的Visual Studio(2013)似乎可以工作在VS中:转到SQL Server Object Explorer,连接到有问题的服务器,右键单击有问题的数据库,提取数据层应用程序,然后调整提取设置,其中之一是验证提取".我不知道为什么MS不只是将其内置到SSMS中.

I wasn't able to find a method that works in SSMS (2008 R2 or 2012), either, but Visual Studio (2013) with SSDT seems to work: Within VS, go to SQL Server Object Explorer, connect to the server in question, right click the database in question, Extract Data-tier Application, and then adjust the Extract Settings, one of which is "Verify extraction". I don't know why MS doesn't just build that into SSMS.

我从中注意到的一件奇怪的事是,VS将仅通过此方法提取.DacPac.即使您选择将数据添加到提取中,扩展名仍然是.DacPac.我的印象是.DacPacs仅用于架构,而.BacPacs是用于架构+数据.无论如何,在VS创建.DacPac(架构+数据)文件后,SSMS可以使用部署数据层应用程序..."向导将其导入.

One somewhat-odd thing I noticed from doing, this, though, is that VS will only extract a .DacPac via this method. Even when you choose to add data to the extract, the extension is still .DacPac. I was under the impression that .DacPacs were solely for Schema Only, while .BacPacs were for Schema + Data. Regardless, after VS created the .DacPac (Schema + Data) file, SSMS was able to import it fine using "Deploy Data-tier Application..." wizard.

这篇关于如何在不使用VerifyExtraction的情况下将MSSQLServer数据库提取为.dacpac?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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