Importing a .bacpac from SQL Azure into a local SQL Server 2016 server gives errors

Posted on

Question :

I’m trying to import a .bacpac created from SQL Azure into a SQL Server 2016 server that has no existing databases beforehand. It will run but run into issues such as:

Unhandled Exception: Microsoft.SqlServer.Dac.Data.DataException: Data
plan execution failed with message One or more errors occurred. —>
System.AggregateException: One or more errors occurred. —>
System.AggregateException: One or more errors occurred. —>
System.AggregateException: One or more errors occurred. —>
System.Data.SqlClient.SqlException: Violation of PRIMARY KEY
constraint ‘PK_ITIssue’. Cannot insert duplicate key in object
‘dbo.ITIssue’.

I have verified the primary key is unique on the source database. It will also throw errors for some foreign key relationships. It stops importing the table it’s on and continues to the next one.

Answer :

Please download the latest version of SSMS to import the dacpac.

Download it from here.

Hope this helps.

Regards,

Alberto Morillo

Leave a Reply

Your email address will not be published. Required fields are marked *