Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import bacpac fails with "does not contain QueryStoreStaleQueryThreshold"

I am getting the error below when trying to import bacpac file from Azure sql database with management studio 2014. I have upgraded the Azure sql database to v12 and suspect it has something to do with this, but it works with some v12 databases and fails on some.

Does anyone know how to resolve this?

Could not load schema model from package. (Microsoft.SqlServer.Dac)

------------------------------ ADDITIONAL INFORMATION:

The Element or Annotation class SqlDatabaseOptions does not contain the Property class QueryStoreStaleQueryThreshold. (Microsoft.Data.Tools.Schema.Sql)

like image 475
Jonas Røineslien Avatar asked Oct 26 '15 08:10

Jonas Røineslien


People also ask

How do I import a Bacpac file?

Steps to Import/Restore BACPAC file. Open SQL Server management studio, connect to SQL instances where you want to restore database and right click on Database. Then you will get option as shown in below picture. Click on Import Data-tier Application.


Video Answer


2 Answers

Let me try and help here. We've seen other users report this when they have also enabled the new Index Advisor feature. There is a workaround along with a detailed description of the issue here. https://social.msdn.microsoft.com/Forums/azure/en-US/ac9deff4-e0fe-4de0-98ec-9059e917e0bc/database-export-bacpacs-can-no-longer-be-imported-sqldatabaseoptions-querystoredesiredstate?forum=ssdsgetstarted

like image 93
guyhay_MSFT Avatar answered Oct 01 '22 03:10

guyhay_MSFT


This did the trick for me..

ALTER DATABASE [Database-Name] SET QUERY_STORE = on;
GO
ALTER DATABASE [Database-Name]
SET QUERY_STORE (
    OPERATION_MODE = READ_WRITE,
    CLEANUP_POLICY = 
    (STALE_QUERY_THRESHOLD_DAYS = 367)
);
GO
ALTER DATABASE [Database-Name] SET QUERY_STORE = off;
GO

I made a new bacpac and imported that one and it worked..

like image 31
Peeta Avatar answered Oct 01 '22 05:10

Peeta