Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract MSSQLServer database as .dacpac without VerifyExtraction?

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.

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.

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.

Is there a way to configure SSMS to disable verification?

like image 483
Michi-2142 Avatar asked Nov 05 '14 13:11

Michi-2142


People also ask

How do I extract a Dacpac file?

Right-click the DAC package (. dacpac) file and select Unpack. Double-click the DAC package file.


1 Answers

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.

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.

like image 67
Jon Avatar answered Sep 28 '22 03:09

Jon