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.
Related
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.
Me
An SQL newbie
My tools
VS Community 2017 v15.9.3 / C#
SQL Server 14.0.2002.14
SSMS 14.0...
What I want to do
I have a file, you say mydatabase.mdb, I am trying to create a connection to the database on SQL Server to access to it.
The database is not actually attached to SQL server, so I try to create my connection and attach it (correct?) using Server Explorer window on VS. I right click on "data connection" then choose "add connection"; in the "add connection dialog" I select the datasource "Database file of Microsoft SQL Server" and I give it the pathname of my file. Finally I hit "Test Connection".
The problem
On "Test Connection" I got this message:
The database 'mydatabase.mdb'cannot be opened because it is version 869. This server support version 852 and earlier.
Could not open new database 'mydatabase.mdb', CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file 'mydatabase.mdb' failed. A database with the same name exists, or specified file cannot be open or it is located on UNC share
My attempts
I connected the databse to SSMS. When I asked DB version to SSMS, I got: SQL Server 2016 (130). It is not congruent with MS error report. Anyway I changed database version to 2014, then I detached it from server and try again: same result.
Last note: if I create my connection on attached (by SSMS) database, and specifing directly the SQL server (not the file) as datasource, it seems to work. I could use this way, but I'd like to know the cause of the problem.
Can anyone help me?
You may have installed VS 2012, but you are using a SQL 2008 instance: Visual studio does not install SQL for you.
SQL Server 2008 databases are version 655. SQL Server 2008 R2 databases are 661. You are trying to attach an 2008 R2 database to an 2008 instance and this is not supported.
You need to upgrade your SQL instance to at least 2008R2 to open the file (but be aware that if you subsequently attach your existing DBs to the new instance, you won't be able to open then in SQL 2008 again either)
Your SQL Server version (the server that reported the error) is 2016, that is, it supports db version 852 and earlier.
The database that you try to attach is of version 869, this means it was created on SQL Server 2017.
You cannot attach it to an earlier version of SQL Server, so you need to upgrade your server to 2017 or install another instance of SQL Server, SQL Server 2017.
P.S. You CANNOT downgrade database version, i.e. when you said
I changed database version to 2014
it is not true.
Maybe you just change the compatibility level of database, but it's version is still 869.
Compatibility level means a version of cardinality estimator to use + some features, it has nothing to do with database version that refers to physical file format. Database version cannot be downgraded, only upgraded.
P.P.S.
I connected the databse to SSMS
You cannot "connect database to SSMS", you are connecting to server, and the database is also attached to server. And if you were able to attach this database to SQL Server, this means you have SQL Server 2017 already installed.
P.P.P.S. To detect your SQL Server version you shopuld execute this code: select ##version (from SSMS). It seems that you have at least 2 servers, 2016 and 2017 on your pc. You can verify this by opening SQL Server Configuration Manager, or you can use Windows Services to determine how many instances you have and what are their names. Then all you should do is to use the correct instance.
Here is the picture of my SQL Server instances, you can verify your instances by launching services.msc on your pc.
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)
I performed what I thought was an upgrade from SQL Server Express 2012 to 2014 by running the 64-bit executable. Everything seemed to be working fine during installation as it recognized my existing server instance (2012) which I presumed would be upgraded to 2014.
However, when I try to restore a 2014 DB from my web host, I get the following error:
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.5343. Either restore the database on a server that
supports the backup, or use a backup that is compatible with this
server.
I definitely have 2014 installed, but when I view my instance from inside SMS 2014 it looks to still be running on SQL version 11.xxx which I presume is 2012 (the name of the instance is the same as it was when I was running 2012).
Did I do something wrong during the installation? How do I upgrade my instance to 2014 so that I can restore my DB locally?
downloadsqlserverexpress.com helps to find the correct download of SQL Server Express from MS Download Center. You need the one that contains the SQL Server Engine, not just Management Studio.
sqlserverbuilds.blogspot.com.au has a full list of SQL Server versions and builds.
Using it we can see that you are running Management Studio 2014 (build 12.0.2000.0), but you are connecting to SQL Server 2012 engine (build 11.0.5343).
Maybe you now have two engines running (both 2012 and 2014). You can check the list of running processes and verify if two instances of sqlservr.exe are running.
It should be possible to upgrade the engine in place by installing 2014 on top of 2012. I don't know why it didn't happen in your case. You could have chosen to install only Management Studio even if you had a full installer.
One long, but sure way to clean up would be to uninstall everything related to SQL Server and install 2014 again. Make proper backups of databases at first, of course.
I have SQL Server 2008 and VS2008 installed on my computer and I am trying to run a web application I've created on a computer which has SQL Server 2008 and VS2008 and VS2010 beta 2 with its SQL Server Express.
I am getting an error with the database version that is
"...aspnetdb.mdf" cannot be opened because it is version 655. This server supports version 612 and earlier...."
Configuring the database in Visual Studio ->Tools -> Options -> Design-Time Validation Database is not working since I don't have the SQL Server version comes with VS 2010.
EDITED : I also edited aspnetdb and inserted a few more tables so I need the same aspnetdb
Is there any solution to convert this db ?
Also, after fixing this, I am looking forward to upload it on my hosting which has SQL Server 2005 DB and configure it in PLESK.
The SQL Server databases have a version specific format. Each SQL Server runtime version (SQL 2008 SP1, SQL 2008 RTM, SQL 2005 SP2, SQL 2005 SP1, SQL 2005 RTM etc) knows how to upgrade to its own verison. Unfortunately, once upgraded the database cannot be downgraded. So if your MDF was upgraded to version 655, it cannot be downgraded to any prior version. If you know you're going to deploy on SQL Server 2005, you must develop on SQL Server 2005 too. Not only that, but the actual build number of your development has to match the build number of the deployment (or at least be lower than that): the SP level and CU level must match.
You can a attach the 2008 version MDF you created to a SQL Server 2008, script out the database content, then import the script into a SQL Server 2005 database of the proper version.
I had this problem and when I changed my_computer_name\SQLEXPRESS with . to connect to server and it works and I could attach MDF file
may be you have both services run. (Mssql2008 and mssqlexpress) Maybe you have runing the mssqlespress running, that's the error that you have. Try to stop the mssqlserver express service and run mssql2008 services, and attach again your databases. I try this and works for me