Import bacpac fails with "does not contain QueryStoreStaleQueryThreshold" - azure

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)

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

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..

I experienced the same problem with Management Studio 2016 CTP 2.3 (August preview). I have updated to Management Studio 2016 CTP 3.0 (October preview) and the .bacpac import works as a charm.

I had same issue, I got Index Adviser active. I had SQL server 2014 Management studio. I upgrade to SP1, and try to install some hotfix, but nothing work. I was about to install 2016 edition, but then as last try instead of downloading Bacpac from Azure Portal, I use Management studio 2014 sp1 to connect to my DB and Export the Bacpac, and then try to import that Version it goes through fine.
I don't have to run those queries to turn off adviser, or any alteration. So just want to suggest if you have SQL server 2014 Edition upgrade it to SP1 and then export DB using it, this ensure that you create Bacpac that is compatible with that Management studio version as management studio is one that is writing the bacpac. Hope that help someone, who don't want to alter db.
on my machine, download bacpac from Azure's portal still don't work.

Related

Deploy Azure SQL Elastic Database query

I have multiple Azure SQL databases. One database holds all the staging table and the other database holds all the fact/dim tables. Now in my development environment I have stored procedure which reads data from staging tables (from staging database) and loads the data into its respective fact/dim tables (in a different database).
The above scenario is all working fine. I have multiple SQL projects for each database.
Now how do I deploy the elastic database queries while deploying the dacpac?
Below is the error when I add the elastic queries as a part of my post deployment scripts in Visual studio and try to build it.
PS: The SQL project properties is set to target the V12 version of the Azure SQL Database
Which version of the SQL Server Data Tools (SSDT) are you using? If you are not using the latest (14.0.60413.0), give it a try to upgrade SSDT: https://msdn.microsoft.com/en-US/mt429383. With that version, I am now successfully able to compile and publish database projects and dacpacs.
To successfully build, you will need to install the latest SSDT Preview which includes support for these objects from here. Support for the latest Azure SQL DB and SQL Server 2016 features is only available in the Preview for VS2013 at present, whereas for VS2015 the support was shipped in VS2015 Update 2. Once SQL Server 2016 goes GA (June 1, 2016) an RTM update will be pushed through the Visual Studio 2013 Extensions and Updates channel containing this support. That will ensure you get monthly updates with the latest changes again.
Note that even with the latest bits, if you open the file itself you'll get an issue with the Intellisense parser. Building the project will work fine but on opening a document you will see the errors appear for that specific document. Note that the same issue occurs in SSMS when coding this into a query window. This is because the Intellisense parser is separate from the core build system. The fix for this is in progress and will land in a post-SQL Server 2016 update (likely late June - July timeframe).
Disclosure: I work on the SQL Server tools team.

Incompatible MS SQL server version with devexpress version 15.x

I'm trying to add a Project Data Source in a GridView in DevExpress.
I click on the little arrow on the above right of the Gridview. I choose 'Add project Data Source'.
Then I choose, a Data Type source => DATABASE.
Then, 'Database model' =>DATASET.
Then, for 'Data connection' I choose MS SQL Server.
I then choose the server and I get a pop-up windows that says:
This server version is not supported. You must have SQL Server 2005 or later.
Now, I've confirmed that the server I'm trying to connect to has Microsoft SQL Server 2000 installed on it.
I know that some people got that pop-up window when trying to use Microsoft SQL Server 2008. It was apparently a Visual Studio issue.
I just want to confirm that this message that I'm getting is legit. (It would seem right, seeing, as I
mentionned earlier, I have Microsoft SQL Server 2000 installed. ) For some reason, I still
think it's weird that I'm getting this message. I have Microsoft Visual Studio 2012 by the way. Can anybody confirm this.
I do not think that this issue is related to DevExpress control. It is common issue with visual studio when you SQL Server that Visual studio IDE does not support or missing SQL Server Data Objects.
I suggest you to check below link for your confirmation that SQL Server is not supported in newer IDE directly.
This server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later.
SQL Server 2000 and Visual Studio 2010
This Server Version is not supported. You must have SQL 2005 or later (VS2010 Problem)
Some how you can use quick fix to connect with the data base and write code to do other operations.
Connecting SQL server 2000 using Visual Studio 2012
.NET Framework Data Provder for OLE DB -> Microsoft OLE DB Provider
Hope this help you understand the real issue behind this.

Unable to import SQL Azure V12 BACPAC: "type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid"

I am trying to import the exported BACPAC from an SQL Azure (v12) database into a local SQL Server 2012 instance, but I keep getting the error below. I have tried installing the DAC and SSDT updates linked from this blog post, but it's not helping.
How can I fix this?
TITLE: Microsoft SQL Server Management Studio
------------------------------
Count not load schema model from package. (Microsoft.SqlServer.Dac)
------------------------------
ADDITIONAL INFORMATION:
Internal Error. The database platform service with type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service. (Microsoft.Data.Tools.Schema.Sql)
------------------------------
BUTTONS:
OK
------------------------------
Updated: The new SQL Server Management Studio Preview is the best way to Import to Azure SQL DB. It has support for all the latest Azure SQL DB features and validations. In addition it has a standalone web installer that is automatically updated each month as new features become available. Given comments below mentioning the difficulty of installing a CU update, this would be a simpler & quicker solution to the problem.
Original Answer:
If you are using SQL Server Management Studio to perform the Import, you must have SSMS 2014 CU5 or CU6 installed. Information on installing CU6 is available here. The error shown in your question indicates you're using an older version of SSMS.
**Update: **
In response to Martin's answer below, I'd like to clarify 2 things.
SSMS for SQL Server 2014 is the only version of SSMS with full support of the new Azure SQL DB v12 features, notably Import/Export against this target. This is because v12 has (almost) feature parity with SQL Server 2014 and older versions of the tooling do not have support for this. Note that SSMS 2014 is fully backwards compatible with SQL Server 2005 and up.
There was a separate, temporary issue that caused problems with databases upgraded Azure SQL DB v12. This has been resolved and the correct place to find information about solving this are in section C3 of the Plan and Prepare to Upgrade page. In summary if you've exported a bacpac that is failing to import due to this issue you can download the latest DacFramework.msi from here to fix this issue in SSMS.
Full disclosure: I work on the SQL Server tools team.
To fix import error with [sys].[script_deployment_databases] from exported V12 Database you have to install:
CU13
Microsoft SQL Server Data-Tier Application Framework (February 2015) (you must install BOTH the x64 and x86 versions).
EDIT: CU13 is not necessary, just try second link first!
Install the following and it will work!
1) Have you installed Cumulative Update 5 for SQL Server Management Studio 2014. http://support2.microsoft.com/kb/3011055
2) Microsoft SQL Server Data-Tier Application Framework (February 2015) (you must install BOTH the x64 and x86 versions). http://www.microsoft.com/en-us/download/details.aspx?id=45886
I had the same problem with my dataabse backup from SQL Azure (v12).
I've installed Microsoft® SQL Server® Data-Tier Application Framework (February 2015) (in order to work correctly you will need install BOTH the x64 and x86 versions).
First I've installed x64 version and tried to restore the DB - but it didn't work. After that I've installed x86 version and I could successfully restore the database.
My SQL Server version: Microsoft SQL Server 2014 - 12.0.2269.0 (X64). OS: Windows 10 x64 build 10240.
Tnanks.
BacPac restore from Azure DB fails after installing latest SQL Server Management Studio 2016 Preview. Solution was to set "Contained Database Authentication" = 1 for my local SQL DB instance. Read about solution here or run this script on your local instance:
USE master
GO
RECONFIGURE
GO
sp_configure 'CONTAINED DATABASE AUTHENTICATION', 1
I was using wrong SqlPackage.exe path.
Does not work:
C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe
Works:
C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin\SqlPackage.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\SqlPackage.exe
I'm having the same issue.
Installing Cumulative update package 6 as suggested here helps to avoid the first bug but just to get stuck in the next one.
Related to this topic:
SQL Azure import of bacpac does not work after upgrade to v12
it's a bug Microsoft has no fix or workaround yet.
Edit: SQL Management Studio 2014 is required to restore (2012 doesn't work)
If there's one, I think the thread will be updated.
Edit: In the above mentioned link you now can find a workaround: You need to create a copy of your V12 database. This copy can be exported and reimported on your local sql server 2014.
Just updating the tools doesn't help.
I'm using version 11.0.2100.60 and had the same issue. Installed Microsoft® SQL Server® Data-Tier Application Framework (February 2015). All worked fine after that.

Windows Azure Sql Database Management Portal Error

I ve done some research and i can't seem to find anything similar to this.
I have an SQL Database from Windows Azure with several tables. I can log in just fine and view all the table data of all tables, except from a specific table.
When I click on the "Data" section of that specific table, my screen just goes completely blank and then I can't do nothing about it, apart from starting over. Any thoughts on this ?
(I have the latest version of Silverlight installed and I ve tried with Chrome,Firefox and Opera)
Thanks
You can use SQL Server Management Studio (SSMS) 2008 R2 for browse or what ever the task you have to do with SQL azure database as a alternative for your way of method.
Using SQL Server Management Studio 2008 R2 to Manage SQL Azure sample screen is as below.
For more information check this out Getting Started with SQL Azure Development
UPDATE
If you're going to use express edition, then you have to use SQL 2012 express with Win 8.
Check this out SQL Express Edition 2012
I hope this will help to you.

How to ignore users in VS 11 Sql Server Database project publish

Problem
I can't figure out how to ignore users in my vs 11 beta sql server db project when publishing.
Why is this a problem
This is a problem because I want to keep the setting where I want to drop objects that are not in my project but are in the db being published to. If I delete a sproc in my project I'd like to drop the sproc in my db.
Any ideas? I've looked at all of the publish settings and just can't seem to figure it out....
Encountered this as well, since it persists in Visual Studio 2012 RTM / SP1 with SSDT (SQL Server Data Tools). I reached out to Barclay Hill at Microsoft who works on the product, who confirmed that this is currently not possible:
It is frequently asked for i.e drop everything, but users, permissions
and roles. We have it on our backlog, but have not been able to get
to it yet.

Resources