The database 'C:\SOME\FOLDER\MYDATABASE.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.
Background
I had created that database in Visual Studio 2008 (File → Add New Item → SQL Server Database) and now it wouldn't let me open it!What I had done is opened, edited and closed the database file using SQL Server 2008 Management Studio. Shouldn't be a problem, right, since I'm also using Visual Studio 2008?
The Problem
Well, although I currently have SQL Server 2008 installed, I also have SQL Server 2005 (which was installed with Visual Studio 2008 originally). When I created the database originally I just assumed it was a SQL Server 2008 database - but it wasn't (it was 2005)!Turns out that when you are create or open a file-based (.MDF) database (as opposed to using a database instance or server connection) Visual Studio needs some 'help' knowing what tools to use.
When I edited the *.MDF file in SQL Server 2008, it made some fundamental "changes" to the file (even though I didn't 'upgrade' it) which prevented SQL Server 2005 from opening it. Why was Visual Studio 2008 confused? It's a configuration setting!
To fix the problem, go to Tools → Options... → Database Tools → Data Connections and change the SQL Server Instance Name from whatever it was (probably a SQL Server 2005 instance) to your SQL Server 2008 instance, hit OK and you should be fine!
Thanks to simple-talk; and SQL 2008 Express edition error/Add new item on ASP.NET forms. A bit OT - HTH someone...
I am having this same problem working on my senior project. Am using VS2008 and have created an SQL database in VS which I connect to. However when I take it to the lab I get this same kind of error. Do you think I can 'downgrade' to the SQL2005 like you are doing above? In my 'connection options' window my field shows SQLEXPRESS. From what it shows above I should be able to do this, just wondered if you think so.
ReplyDeleteHI I FOUND YOUR ERROR DONT CHANGE SQL2008 JUST CHANGE YOUR SERVER NAME(NAME INSTANCE).
DeleteWHICH NAME YOU TYPE WHEN INSTALL SQL SERVER THAT IS THE NAME INSTANCE
You can see the following article : https://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/
DeleteAs I have resolved same issue.
No, you cannot downgrade (the Microsoft documentation specifically says this).
ReplyDeleteThe instance name SQLEXPRESS could be either 2005 or 2008, so that doesn't really help you.
I am not 'downgrading' my database, I am "telling" VisualStudio to use the 2008 'instance' to communicate with the MDF.
The MDF file that you are creating at home and taking to the lab will either be in 2005 or 2008 format. If your lab at school only supports 2005 then you will need to have SQL Server 2005 (or 2005 Express) installed at home, and have THAT instance name showing in the dialog 'above'.
Hi,
Deletewhile attaching the database in sqlserver2008 to vs2010 ,Im getting the error message.Will you please tell me the solution
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'PREETHI\SQLEXPRESS'. (Microsoft.SqlServer.Smo)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
The database 'EmployeeDB' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.
Could not open new database 'EmployeeDB'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)
my dear
ReplyDeleteI have same as this problem >
but > How I know the name of my SQL SERVER 2008 ?
may be it is the problem .
thanx
Look in Administrative Tools -- Services
ReplyDeleteThe 'default' SQL Server instance will be listed as
SQL Server (MSSQLSERVER)and can usually be referenced by (local)
Any other named instances (eg. a new 2008 install) will have a different name (which you would have typed/agreed to during install!)
SQL Server (SQL2008) -- I chose SQL2008 as my instance name: yours could be anything.
thanx my dear:
ReplyDeletebut Now I know what was the problem.
when I was installing the visual studio with it directly installed the SQL Server 2005 and it became the Local Server on my Computer.
and I have SQL SERVER MANAGEMENT 2008 .
I went directly to (add and remove programs) and I deleted the SQL Server 2005 (Local)
my computer Now becames without Local Server
What can I do?
I want to get Local Server 2008 or 2007 > but I cannt find it
can you help me please ?
thanx
Sorry Meshal, I'm happy to try and help but I cannot provide SQL Server Support - sounds like you need to contact Microsoft.
ReplyDeleteI'm not sure why you deleted SQL Server 2005. I explained in my previous message how to find out the instance name of other SQL Servers on your computer by looking in the Services window.
Perhaps you should re-install SQL Server 2008 (the Express version is free and can be downloaded from Microsoft).
Good luck!
Thank you so much for this. I was having the exact same problem: Created in VS, edited in SQLExpress 2008, couldn't work with it in VS.
ReplyDeleteKudos!
Hi,
ReplyDeleteI had the same issue as you, but in a different sequence
- installed VS2008
- open the .mdf file using VS2008 alone
- installed SQL Server 2008
- open the .mdf file using SQL Server 2008
- tried to open the .mdf file using VS2008 and got the error msg
I've already changed the Server Instance Name to both "SQLEXPRESS" and "MSSQLSERVER" but both don't work. I didn't change anything during the installation, so most likely it should be either one. What can I do to resolve this issue? Thanks.
@PeakTooSoon, trying those random names is only going to work by luck. Open your Services list from Administrative Tools and have a look at *exactly* what your instance names are. Then choose the 'correct' one (ie. SQL Server 2008 - look at the Service-Properties path to figure that out) and set up Visual Studio as above.
ReplyDeleteThat's really the ony advice I can provide - it *should* work...
Hi Craig,
ReplyDeleteI've checked my services and I found 2 services with the names "SQL Server(MSSQLSERVER)" and "SQL Server (SQLEXPRESS)" without any indication which one's 2005 or 2008. Other than that, I can't find any other services that resembles an SQL Server.
In Services, right-click on the SQL Server() rows and look at the "Path to executable"... somewhere in the path you should see some indication of the version, eg MSSQL probably means 2005, MSSQL10 means 2008.
ReplyDeleteGood luck. Otherwise maybe it's a different problem.
Hi Craig,
ReplyDeleteFound your blog 2 b quite praiseworthy. However, the problem is the other way around. I created a database at office via SQL Server Mgt Studio.
I copied the files MICAS.mdf & MICAS.ldf brought the same home on a disk. Copied on my personal laptop with Vista Home Premium + VS2008(SP1) + SQL Server Mgt Studio at home gives the same error, although I have changed the instance name from SQLEXPRESS to SQLFARAZ as found both names in services.
Whereas VS2008 had no role in creating it?
Furthermore, even when I use the SSMA to convert a Access Database to SQL 2008 it comes up with the error You must connect to an instance of SQL Server 2008.
Hi, Craig Dunn mentioned going into Administrative Tools to see what your 'instance' names are. (that post is over a year old). Where is this Adminisrative Tools? Is it in VS or Sql server? or maybe Windows? I'd like to give that a try since nothing else is working.
ReplyDeleteI'm talking about the version 655 vs 612 problem
Thanks
"Administrative Tools" is a Windows feature. It should be available in "Control Panel" (on the Start menu).
ReplyDeleteProblem resolved only after uninstalling and reinstalling the SQL Server's latest version
ReplyDeleteThanks Craig
ReplyDeleteFaraz,
ReplyDeleteWhat version of SQL server do you have, and are you talking about the 612 vs 655 problem?
Thanks
I have two versions of SQL Server too (2005 and 2008) and had the same problem.
ReplyDeleteIn Tools → Options... → Database Tools → Data Connections I changed the SQL Server Instance Name to blank so my database opened without any problems.
Thank you for this, very succinct solution to my problem.
ReplyDeleteThanks a lot, your post was the perfect solution.
ReplyDeleteI Craig, i have a question. how do i know if i have sql2008 installed.
ReplyDeletebecause, when i go to the starbar->all programs, all i see is microsoft sql server 2005. Also, i did that thing on Services, and all i see is this: "c:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe" -sSQLEXPRESS
how can i know if i have 2008? And if a dont have, should i uninstall 2005 and instal 2008?
@Aquiteste Sounds like you probably have SQL Server 2005. You could try 'right-click > Properties' on that file from Services and see the version:
ReplyDelete8 = SQL Server 2000
9 = SQL Server 2005
10 = SQL Server 2008
>>should i uninstall 2005 and instal 2008?
I can't really answer that for you, it will depend on your needs.
I m having the problem of SQL server.
DeleteThe database cannot be opened because it is version 655. This server supports version 612 and earlier.
Please tell me what to do??
Instance Name is -- SQLEXPRESS
Ok Craig,i'll do that. thanks for helping me.
ReplyDeleteVery helpful! I ended up installing separate instances of 2005, 2008 R2 and 2012 because I support a bunch of different versions.
ReplyDeleteThanks!
Thanks you so VERY much.
ReplyDeleteThanks Craig, this solved my problem too (while trialling Nerd Dinner for AWS).
ReplyDeleteI need to create a database SQLSERVER 2005 from Visualstudio 2010, I have sql server express 2005 installed and i choose the instance of it in the database options, when i try to create the database Visualstudio Throws an error.
ReplyDeleteThe database 'C:\USERS\ADMIN\DESKTOP\DESKTOP ICONS\ONLINE SHOPPING CART ASP.NET WEBFORM\C#\MYPROJECT\APP_DATA\SHOPING.MDF' cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported.
ReplyDeleteCould not open new database 'C:\USERS\ADMIN\DESKTOP\DESKTOP ICONS\ONLINE SHOPPING CART ASP.NET WEBFORM\C#\MYPROJECT\APP_DATA\SHOPING.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file C:\Users\Admin\Desktop\desktop icons\Online Shopping Cart Asp.Net WebForm\C#\MyProject\App_Data\shoping.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
please help me fix this ....thanks
Dear All!
ReplyDeleteJust reinstall all programs starting ms sql and hopefully the problem will be fixed. Worked for me!
Regards,
AAP
The database 'C:\USERS\APEKSHA\DOCUMENTS\VISUAL STUDIO 2010\PROJECTS\ALUMIN MEET\APP_DATA\ALUMIN.MDF' cannot be opened because it is version 706. This server supports version 655 and earlier. A downgrade path is not supported.
ReplyDeleteCould not open new database 'C:\USERS\APEKSHA\DOCUMENTS\VISUAL STUDIO 2010\PROJECTS\ALUMIN MEET\APP_DATA\ALUMIN.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file C:\Users\APEKSHA\Documents\Visual Studio 2010\Projects\alumin meet\App_Data\alumin.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
plz help me to fix this......
Thanks