Error when exporting bacpac file from local database - sql-server

I am trying to deploy a local database to an azure sql databse.
When i use the tool in Management Studio (Tasks > Deploy Database to Microsoft Azure SQL Database) I get an error when the process starts to export the database. I get the same error when I try to export the bacpac manually. The error is:
Could not extract package from specified database. (Microsoft.SqlServer.Dac)
Internal Error: Ese could not be initialized. (Microsoft.Data.Tools.Schema.Sql)
Internal Error: Ese could not be initialized. (Microsoft.Data.Tools.Schema.Sql)
Out of Memory (Microsoft.Data.Tools.Schema.Sql)
A few hours of google searching is coming up with nothing.
I came across a tool called sqlpackage.exe that I am going to try, but I would really like to get this working from the tooling in Management Studio.
Management studio version: 13.0.15700.28
Local SQL Server Express version: 13.0.4224.16
Do these versions matter? Before I go and re-install everything, I assume they are independent of each other?

It is best to use the latest GA version of SSMS, especially when targeting Azure SQL Database. Newer SSMS versions can be installed side-by-side with older versions. However, that is generally needed only when you need to support old SQL Server versions like SQL Server 2005. The latest GA SSMS version (as of this writing) supports the SQL Server 2008 through SQL Server 2017. The current preview version also supports SQL Server 2019.

Related

SQL Server bacpac fails on local import in latest update (Online index operations can only be performed in Enterprise edition of SQL Server)

I have an SQL Azure database and connect to it in SQL Server Management Studio. I do Export Data Tier Application and then Import Data Tier Application for the .bacpac file to get it into my localdb. Or I use Tasks - Deploy Database.
Either way, it worked up until recently and now I get an error
Online index operations can only be performed in Enterprise edition of SQL Server
I am using SQL Server Management Studio versions below (from Help - About). Any ideas?
SQL Server Management Studio 15.0.18369.0
SQL Server Management Objects (SMO) 16.100.46041.41
Microsoft Analysis Services Client Tools 15.0.19342.0
Microsoft Data Access Components (MDAC) 10.0.19041.1
Microsoft MSXML 3.0 6.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 10.0.19041
Among bug fixes in SSMS 18.9:
Fixed in issue where importing a bacpac into SQL Express may fail. See SQL Server user feedback.
This issue with SSMS 18.8 had been acknowledge by the product team, but was fixed:
I apologize for the inconvenience of this issue, we are working to include a fix in the next release of SSMS. In the meantime, installing SSMS 18.7.1 (https://learn.microsoft.com/sql/ssms/release-notes-ssms?view=sql-server-ver15#1871) will allow you to complete the bacpac import operations on SQL Server Express.
If instead of using localdb you can upgrade to or use SQL Server 2019 Developer Edition, then you won't have any issues. Developer Edition is free and has the same features as Enterprise Edition. You can download Developer Edition from here and then update it with the latest cumulative update from here, after that try to import the bacpac to the Developer Edition instance.
I just ran into this same exact problem again today. I exported our database from Azure into a BACPAC and was having trouble with SSMS loading it into SQL Express.
Just by pure luck, I found SSMS 18.9 was released today and appears to have fixed the issue in my case.

Can't import bacpac file from Azure to Local SqlServer 2012

I exported a bacpac from Azure SQL Database and am trying to import it on my local environment.
It works perfectly on my development machine running SQLServer 2016, but if I try and install it on a server running SQLServer 2012, I get a compatibility issue.
'A project which specifies Microsoft Azure SQL Database V12 as the target platform may experience compatibility issues with SQL Server 2014'
It is definitely not any of my stored procs/tables etc as it is not using anything specific to newer SQL databases.
I am using the latest SSMS and have also tried installing some of the Data Tier application hot fixes that some people have mentioned, but no joy.

Northwind.mdf - This database file is not compatible with the current instance of SQL Server (in Visual Studio 2017)

I want to practice with some database that I want to use inside Visual Studio 2017.
I had Northwind.mdf that I downloaded some time ago. But when I try to connect to it from VS2017 Servers panel, I get error message:
This database file is not compatible with the current instance of SQL Server.
Q1: Why?
Q2: Where and how do I know the version of Northwind.mdf?
Q3: Where and how do I know which version of database is supported by VS2017?
Q4: I can create my own database in VS2017, but why I cannot use the existing database?
SQL Server only supports databases up to two versions ago, I don't know what version of SQL Server comes with VS2017 but I suppose that is at least SQL Server 2016 (you can check it using the query select ##version), so it supports at most DB's from SQL Server 2012 and Northwind is for SQL Server 2000.
If you really, really want to use that database you have an upgrade path, is a bit cumbersome but is free (you should use a virtual machine for this if you can, I sometimes use the VM's that MS offer for testing IE for this sort of things):
Download and install SQL Server 2008 R2 Express, which is the last version that supports databases from SQL Server 2000. Import the database and make a full backup (you can also attach and detach the database files but I prefer to use backups).
If the version returned by select ##version if SQL Server 2016 or higher, download and install SQL Server 2014 Express. Restore the backup from 2008 to a new database and then make another backup of that database (if you are using this version just restore the backup in your current SQL Server and you are done).
Finally, restore the 2014 backup in the SQL Server used by VS2017.
Note that is you already have SQL Management Studio (or it's integrated in VS2017) you don't need to install the previous versions, since it can connect to different SQL Server versions (if you do all the installs on your system you shouldn't install the previous versions of Management studio, take care of this). Also, if you are doing this in your system I recommend uninstall the step versions as soon as possible.
i have the same problem, i want to use the northwind in VS2017 environment.
(btw - w3scoolsuse this northwind db to teach sql (october 2018)
so i download the sql script from here, install it and run it from cmd in my computer
sqlcmd -S (localdb)\mssqllocaldb -i InstNwnd.sql
This create db in my computer that i can access by sqlcmd, and by visual studio 2017.
If you want those files (without build it yourself) you can download it from my google drive ( i will upload it to github someday and change the link)

After upgrade to 2016 can't import Azure V12 bacpac

We've recently upgraded our development server from 2014 to 2016. We had already been using some 2016/Azure V12 functionalities on production in certain views.
Now that we want to restore a recently exported bacpac file from our production database on Azure, it fails with the following message:
Perhaps the internal DB engine is still running on 2014? I couldn't find anything concrete about it on Google.
The documentation on STRING_AGG() indicates the feature is available in Azure SQL Database and SQL Server 2017, but not SQL Server 2016. You need to use only common features if you want to import BACPACs between different versions.
If this was working before the on-prem upgrade, I suspect that was before the proc with STRING_AGG() was created or changed.

Issues restoring a Database in SQL Server 2014 Management Studio

I took a project where I have to do a few fixes to a website and I'm having several problems trying to import the DB from a backup to my local computer.
The message I got is the following:
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The database was backed up on a server
running version 12.00.2000. That version is incompatible with this
server, which is running version 11.00.3000. Either restore the
database on a server that supports the backup, or use a backup that is
compatible with this server. (Microsoft.SqlServer.SmoExtended)
The thing is I'm running SQL Server 2014 Management Studio and it is a 12.2000.8 version so it should work, but it doesn't.
As a second option I tried to generate the script (as I can connect to the remote DB) but it also doesn't let me. It just gives an error somewhere in the middle of the creation of the script.
Any ideas what could I be missing or what can I do to fix this?
I'm working with win 8.1, VS 2014 & SQL Server 2014 Management Studio everything up to date.
Regardless of the version of management studio you're using, the version of the database instance sounds like it's 2012. If you create a backup with 2014, you won't be able to restore on a 2012 instance.

Resources