Reputation: 107
I need to convert a file DATABASE.MDF
from SQL Server 2008 to SQL Server 2012?
Database 'Sales' cannot be upgraded because its non-release version (539) is not supported by this version of SQL Server. You cannot open a database that is incompatible with this version of sqlservr.exe. You must re-create the database.
Could not open new database 'Sales'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 950)
Upvotes: 5
Views: 25347
Reputation: 41
The OP seems to have been mistaken about his DB type. Version 539 of SQL Server is not 2008 but SQL Server 2000. See this thread: SQL Server file version number: where can I find a reference?
I've run into this same error message trying to attach/restore a SQL Server 2000 db to an instance of SQL Server 2012. Perhaps there was a way around it, but what I did instead was first convert to SQL Server 2008 R2, and then to SQL Server 2012. This executed with no trouble.
Upvotes: 2
Reputation: 280320
Just attach it and it will be upgraded. If you don't have the LDF file (and why don't you have the LDF file?) you may have to use:
CREATE DATABASE [DatabaseName] ON
(FILENAME = N'Drive:\path\file.mdf')
FOR ATTACH_REBUILD_LOG;
There are some caveats, of course...
File activation failure. The physical file name "..._log.LDF" may be incorrect.
The log cannot be rebuilt because the database was not cleanly shut down.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'DatabaseName'. CREATE DATABASE is aborted.
*=
/=*
join syntax.FWIW, a much, much, much safer way of moving a database from one instance to another is using BACKUP
/RESTORE
(the reason is that if your backup fails, you still have a copy of the database - if you detach a database, and something goes wrong, you have zero copies). Though some of the issues above may still apply even with this safer approach.
Upvotes: 15