3

We're trying to use SQLPackage.exe to create a database extract 'dacpac' file to be used in the context of a studio based SQL server project. Our goal is to be able to use SQL Server Data Tools to manage our database schema in source control and to allow deployments, etc.

The problem we are having is there are symmetric keys in one of our target databases that causes sqlpackage to throw this error every time:

The command looks like this:

sqlpackage /Action:Extract /SourceConnectionString:"Data Source=MyDataSource;Initial Catalog=MyDatabase;Integrated Security=True;" /TargetFile:MyExtract.dacpac

But we get this error every time:

*** Error extracting database:Could not extract package from specified database.
Error 0: An error occurred while attempting to reverse engineer elements of type 
Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSymmetricKey: Identifier part cannot be null.

I've tried some command-line tricks like using /p:ExcludeObjectType but this parameter is not allowed for Action:Extract

We actually don't care about managing the keys through SSDT and would just like to ignore them. Note the database is on SQL Server 2005 SP3 and I'm using SSDT bundled with Studio 2015...

Brett Green
  • 3,535
  • 1
  • 22
  • 29
  • Do you need to be able to use `SqlPackage` programmatically to repeatedly extract the `DACPAC`, or is this just a one-time deal to get you started? – Dan Forbes Feb 25 '16 at 21:28
  • it's just a one-time deal... plan is to use it for deployments using SSDT schema compare moving forward. – diegohb Feb 25 '16 at 22:53
  • Concur... a onetime deal. – Brett Green Feb 25 '16 at 22:56
  • further context: in SSDT, the bug presents itself by generating SQL script files that are empty lines with GO statements in between... also, schema compare simply reports "no differences detected". – diegohb Feb 25 '16 at 22:57

0 Answers0