17

I recently installed VS2015 Update 2 on two different PC, one at home and one at work, with the same installer file.

Now if I open a project with Sql LocalDB on my own PC, I obtain this error:

The database 'M:\PROJECTS\BLOG\APP_DATA\myBlog.MDF' cannot be opened because it is version 851. This server supports version 782 and earlier. A downgrade path is not supported.

I cannot retrieve information about this 851 version (maybe Sql LocalDB 2016?). I'm sure to have Sql LocalDB 2016 RC0 on both PCs, and I verifies the settings in both VS2015 is:

(LocalDB)\MSSQLLocalDB

Does anyone know how to fix this?

David Tansey
  • 5,813
  • 4
  • 35
  • 51
Rotondof
  • 203
  • 1
  • 3
  • 8

3 Answers3

19

I had the same problem recently, I installed VS2015 Update 2, the same as your environment. Microsoft install MSSQL 2016 RC0 in this update... so there are two or more versions of LocalDB on your computer.

This problem is caused by having different versions of SqlLocalDB on your computers. You can solve this problem by changing the version of SqlLocalDB on one of your computers.

For example, change to version 851 (13.0)

  1. Open CMD , cd to folder of SqlLocalDB (Default : "C:\Program Files\Microsoft SQL Server\130\LocalDB\Binn")
  2. Command "SqlLocalDB.exe delete "MSSQLLocalDB"" , The instance of LocalDB will be deleted.
  3. Command "SqlLocalDB.exe create "MSSQLLocalDB"" , Then you'll see the instance of newest LocalDB version in your computer has been created.

How to use SqlLocalDB : https://msdn.microsoft.com/zh-tw/library/hh212961%28v=sql.120%29.aspx

Good luck!

András Kovács
  • 29,931
  • 3
  • 53
  • 99
Kevin
  • 190
  • 5
0

I had this same issue and error when trying to open a LocalDB. What fixed it for me was installing SQL Server 2014 LocaldB with Service Pack 1. I found the install in my MSDN subscriber downloads. During the install it asked to upgrade the old version and I said yes.

Jason Rowe
  • 6,216
  • 1
  • 33
  • 36
0

mr kevin have given the key to solve this howver this is the commands that work with me

C:\Users\alawi>cd C:\Program Files\Microsoft SQL Server\130\Tools\Binn

C:\Program Files\Microsoft SQL Server\130\Tools\Binn>SqlLocalDB.exe delete MSSQLLocalDB LocalDB instance "mssqllocaldb" deleted.

C:\Program Files\Microsoft SQL Server\130\Tools\Binn>SqlLocalDB.exe create MSSQLLocalDB LocalDB instance "mssqllocaldb" created with version 13.0.1601.5.

albaiti
  • 706
  • 7
  • 10