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

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.

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.

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

Deploy VS2013 SSIS packages to SQL Server 2012 & edit in VS2012

I'm afraid I know the answer to this already, but I'm hoping someone can point me in a better direction. I just finished developing a large ETL project using VS2013. My dev machine has SQL Server 2012 installed, and everything works perfectly executing from within VS. However, I just went to deploy the project to another device running SQL Server 2012, and got a version error.
I thought if I could open the solution in VS2012, the packages might recompile correctly. However, I can't open them in VS2012 due to version errors again ("version can't be lower than current version" error). I'm pissed because everything worked fine in development with the VS2013/SQL2012 combo, but now suddenly it's no good?!?
Can someone please help me figure out how to get these packages downgraded to work with VS2012/SQL2012? There are only a few script tasks involved if that makes a difference. Mostly it's just basic SSIS tasks and data flows.
Thanks.
I found a workaround how you can "downgrade" your SSIS 2014 packages to SSIS 2012. I wrote it on my blog here:
http://vaniecastro.com/2015/02/26/how-to-downgrade-sql-server-integration-services-2014-packages-to-2012/
The idea is that you need to manually modify the XML file, change the PackageFormatVersion and replace ExecutableType property and componentClassID attribute values to use the DTSX2 Version 2012/01 values instead of the DTSX2 Version 2014/01 ones.
You can try using Visual Studio 2015 SSDT Preview. This now allows you to choose which version of SQL Server you want to target, including SQL Server 2012. I successfully downgraded my packages from VS 2013 / SQL Server 2014 to SQL Server 2012 this way.
https://msdn.microsoft.com/en-us/mt429383.aspx
Once the shell is installed, go to the Project menu=>Project Properties=>Configuration Properties=>TargetServerVersion and choose 2012.

SQL Server Data Tool (SSDT) in Visual Studio 2012 not compatible with SQL Server 2012

I cannot create a new SQL Server Database Project on my machine that have installed Visual Studio 2012 Ultimate and SQL Server 2012
I got the below error saying that the SQL Server runtime components not matched.
Do you have the same issue? And what is the work-around for this?
You need to download the latest version of SSDT from http://msdn.microsoft.com/en-us/data/hh297027 (or by clicking the "Get the latest version" link in the error message). SSDT uses a shared component called DacFx, and when you installed SQL Server 2012 on your machine a newer version of DacFx was installed. Updating SSDT will ensure everything is compatible.
Note: Make sure you have a stable internet connection, otherwise you may have issues installing from the web installation and/or the .iso file download.
ISO file download is the problem. This is the second time I have seen the ISO image from MS website has this problem in 1 month. Some are corrupted there are no such files like ".be" prefix "." + file name. Bad file name caused everything.

Resources