12

I recently reinstalled Windows and am trying to set up SQL Server again with an existing database. I've tried installing SQL Server 2012 and 2014, and continuously get the same error. The error says that the database is version 782 and this version of SQL Server is only compatible with 706 and below. I get this error with both SQL Server 2012 and 2014. I thought 2014 was compatible with 782+.. Can anyone provide me with some guidance as to how to attach a damn database? Frustrated...

Image from SQL Server 2014..

and just to note, I get the same error in 2012. Everything was functioning before the OS reinstall.

This is from SQL Server 2014

Liath
  • 9,913
  • 9
  • 51
  • 81
user3308043
  • 797
  • 2
  • 9
  • 20
  • 2
    A 2014 instance cannot possibly state it supports only database version 706 or earlier. The posted error box is therefore from a 2012 instance. – Andriy M Aug 26 '14 at 08:43
  • 1
    @AndriyM It's possible the SQL Server instance is 2012, but SSMS is 2014. Investigating right now. – user3308043 Aug 26 '14 at 08:55
  • @AndriyM How can I upgrade? I tried running upgrade through the original install wizard, it seemed to do something, but @@version still says sql server 2012. I'm running the 2014 wizard.. – user3308043 Aug 26 '14 at 09:07
  • Take a look at this question, maybe something similar happened in your case: [After installing SQL Server 2014 Express can't find local db](http://stackoverflow.com/questions/25163183/after-installing-sql-server-2014-express-cant-find-local-db) – Andriy M Aug 26 '14 at 09:14
  • @AndriyM I took a look but nothing seemed to help. I'm currently installing a major Windows update. Perhaps that includes the 2014 SQL update. I'll post when it's complete – user3308043 Aug 26 '14 at 09:44
  • @AndriyM I posted the solution for me at the end of the answer below. Thanks for your help. – user3308043 Aug 27 '14 at 01:13
  • Related: [The database 'xxx' cannot be opened because it is version 904](https://stackoverflow.com/q/60575236/1364007), [The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported](https://stackoverflow.com/q/26346647/1364007), – Wai Ha Lee Jun 24 '21 at 17:07
  • Does this answer your question? [The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported](https://stackoverflow.com/questions/26346647/the-database-cannot-be-opened-because-it-is-version-782-this-server-supports-ve) – Omer Nov 27 '22 at 12:42

6 Answers6

19

Database must be set to older or same version of the server. You cannot use 2012 server with 2014 database.

According to this link: http://sqlserverbuilds.blogspot.com/2014/01/sql-server-internal-database-versions.html 782 is version 2014 and you cannot use earlier versions.

If you tried SQL Server 2014, update to latest version.

Also make sure you install server not just management tools, since you say that the image is from 2014 but server supports 706, which means it's 2012.

You can do 'SELECT @@version' from your management studio to see on which version of server you're running.

Fedor Hajdu
  • 4,657
  • 3
  • 32
  • 50
  • @AndriyM I assume the OP was using version 2014 of management tools but still running at server version 2012. I've updated my answer. – Fedor Hajdu Aug 26 '14 at 08:44
  • Sorry I removed my comment. I just thought it should better be addressed at the OP. And thanks for the clarification, makes sense, I've seen people run into that confusion before. – Andriy M Aug 26 '14 at 08:45
  • Ok, I ran `print @@version` and it said SQL Server 2012 – user3308043 Aug 26 '14 at 08:48
  • I ultimately ended up finding out that SSMS 2014 was still using SQL Server 2012 under the covers. I uninstalled all SQL files for 2012/2014, reinstalled only 2014, added permissions for the folder where my database was and it ran. Interestingly, I had to give the 'SERVICE' user permissions. Made sure my connection string in Visual Web Developer was ok, everything runs great. Thanks for the answer and pointing me in the right direction. – user3308043 Aug 27 '14 at 00:22
7

If you are using a LocalDB 2014 the all you need to do is make sure that your connection string is pointing to the correct instance.

So change

"Data Source=(Localdb)\v11.0"

to

"Data Source=(Localdb)\v12.0" 

or

"Data Source=(Localdb)\mssqllocaldb"
Yooakim
  • 1,717
  • 2
  • 13
  • 21
  • Also make sure that you start the LocalDB 2014 instance by running `SqlLocalDB start "MSSQLLocalDB"`. That did it for me. – Ionian316 Mar 31 '15 at 13:32
1

From this answer to "The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported".

Try to change the compatibility level - it worked for me.

To verify what level it is:

USE VJ_DATABASE;
GO
SELECT compatibility_level
FROM sys.databases WHERE name = 'VJ_DATABASE';
GO

Then, to make it compatible with the older version:

ALTER DATABASE VJ_DATABASE
SET COMPATIBILITY_LEVEL = 110;   
GO
  • 100 = Sql Server 2008
  • 110 = Sql Server 2012
  • 120 = Sql Server 2014

By default, Sql Server 2014 will change the db versions compatibility to only 2014, using the @@ version you should be able to tell which version Sql Server is.

Then run the command above to change it the version you have.

Additional step: Ensure you look at the accessibility of the DB is not reset, do this by right clicking on properties of the folder and the database. (make sure you have rights so you don't get an access denied)

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
aggie
  • 798
  • 2
  • 8
  • 23
1

I find out two SQL instances were running and on the server name I was mentioning the old SQLExpress instance.

ServerName\SQLExpress

I just change the instance to the newer instance, in this case SQLServer2014 instance and it solved my problem.

ServerName\SQLServer2014
Mahib
  • 3,977
  • 5
  • 53
  • 62
0

Another solution is to migrate the database to e.g 2012 when you "export" the DB from e.g. Sql Server manager 2014. Please find the solution here:

The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported

Community
  • 1
  • 1
Naha
  • 506
  • 6
  • 14
0

Possibly:

  1. You already have installed LocalDB with SQL version older than now.
  2. You did not remove an old SQL express LocalDB, and the connection is to the old LocalDB.

Handling:

  1. Update your sql express to the newest version.

  2. Go to the new installed SqlLocalDB (the default is: "C:\Program Files\Microsoft SQL Server\130\LocalDB\Binn")

  3. list, stop, delete the old LocalDB and other old instance with cmd.exe at administrator's privilege.

    • list: SqlLocalDB.exe i
    • stop: SqlLocalDB.exe p "MSSQLLocalDN"
    • delete: SqlLocalDB.exe delete "MSSQlLocalDB"

Finally, reboot your Visual studio and reload your project.

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
bruce
  • 1,286
  • 11
  • 14