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)
Unless noted in the following table, all features of Windows Server 2012 are supported in all the supported versions of SQL server. SQL Server 2008 R2 requires Service Pack 2 on Windows 8.1 and Windows Server 2012 R2.
Launch SSMS -> Connect to the SQL Server instance -> Right-click on Database -> Click Attach. In the new Locate Database Files window, browse the file system to locate the MDF file. Double-click it. The associated data files and log files are populated in the associated files grid view in the Attach Databases window.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With