Miguel Moura
Miguel Moura

Reputation: 39484

Create and Deploy a DACPAC file with Data

In SSMS 2014 I created a DACPAC file using Tasks > Extract Data-Tier Application.

I then Deployed the file to an Azure SQL Database. The scheme it deployed but all the tables are empty with no data.

How can I export the data? I though that SQL Server 2014 DACPAC file already included the data ...

Upvotes: 1

Views: 5023

Answers (2)

Kim
Kim

Reputation: 1904

You can include data from specific tables or from all tables in a DACPAC by using the SqlPackage tool.

SqlPackage.exe /a:Extract /p:ExtractAllTableData=true /SourceServerName:localhost /SourceDatabaseName:somedb /TargetFile:db.dacpac
SqlPackage.exe /a:Extract /p:TableData=dbo.SomeTable /p:TableData=dbo.SomeOtherTable /SourceServerName:localhost /SourceDatabaseName:somedb /TargetFile:db.dacpac

Upvotes: 1

Simon
Simon

Reputation: 1081

To move a database to Azure SQL you need to extract a BACPAC file which contains the data as well as schema. The DACPAC file does not contain the data.

Go to
Tasks > Export Data-Tier Application and you will get the file required.

Look here for more details : https://learn.microsoft.com/en-us/sql/relational-databases/data-tier-applications/export-a-data-tier-application

Upvotes: 1

Related Questions