I want to attach *.mdf file of Sql server 2000 to Sql server 2008

  • I have a abc.mdf file of sql server 2000 and now i am trying to attach it to sql server 2008.

    and getting this error.

    exec sp_attach_single_file_db @dbname ='abc', @physname='c:\abc.mdf '

    "Database 'ABC' cannot be upgraded because its non-release version (515) 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."

    Is there a way to upgrade the sql server 2000 mdf file to sql server 2008

  • oops i got it other way so removing the contents.

  • BOL instructions to copy database from earlier version

    ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_4deptrbl/html/1f7ccfc6-c68a-4038-8ad7-8d896d041f1c.htm

  • Try attaching and dettaching in 2005 before trying 2008 again.

  • nuthan_kumar (9/20/2010)


    I have a abc.mdf file of sql server 2000 and now i am trying to attach it to sql server 2008.

    and getting this error.

    exec sp_attach_single_file_db @dbname ='abc', @physname='c:\abc.mdf '

    "Database 'ABC' cannot be upgraded because its non-release version (515) 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."

    Is there a way to upgrade the sql server 2000 mdf file to sql server 2008

    from BOL:

    You should move the log files along with the data files, even if you intend to create new log files. In some cases, reattaching a database requires its existing log files. Therefore, always keep all the detached log files until the database has been successfully attached without them.

    Can you try attaching the 2000 .mdf file to an existing 2000 server and re-create the log file. Once this is done, detach the database, copy both .mdf and .ldf files and try attaching to 2008.



    Pradeep Singh

  • i tryed

    "sp_attach_db 'abcd',

    'D:\Old database\abcd.mdf',

    'D:\Old database\abcd_log.ldf'"

    GO

    Then too it dint work, if i attach mdf of 2000 to 2005 it works and then from 2005 to 2008 also it works ,but directly from 2000 to 2008 it is not allowing .

    The application accepts old 2000 mdf files and updates it to 2008 . the application is in vb .net

  • Yes i tried it it is working fine, but the client system is having only 2008 and there is an application which accepts old mdf file and update it to 2008

  • nuthan_kumar (9/20/2010)


    I have a abc.mdf file of sql server 2000 and now i am trying to attach it to sql server 2008.

    and getting this error.

    "Database 'ABC' cannot be upgraded because its non-release version (515) 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."

    That's not a SQL 2000 database. It's a SQL 7 database. SQL 2000 databases have version 539. It's SQL 7 databases that had a database version of 515.

    There's no way to attach a SQL 7 database to SQL 2008. you need to attach it to either SQL 2000 or SQL 2005 first, let that upgrade happen, then detach again and attach to SQL 2008.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the information :-), Is there any stored procedure in sql which can be used to update the mdf files to the latest version,those stored procedure which i can call through .net.

  • Nope. The way to upgrade a SQL database (and said upgrade involves changing the internal file structure, system table definitions and a fair bit more) is to attach it to a higher version. You can attach the SQL 7 database to SQL 2000 or 2005.

    Attaching to SQL 2000 will upgrade the database version to 539, attaching to SQL 2005 will upgrade the database version to 611. After which you can detach and attach to SQL 2008. SQL 2008 can only upgrade databases from SQL 2000 or 2005, nothing earlier

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • read Gail's remark:

    you need to attach it to either SQL 2000 or SQL 2005 first, let that upgrade happen, then detach again and attach to SQL 2008.

    Thats the only way out!!



    Pradeep Singh

  • Attaching MS SQL 2000 DB files (mdf and ldf) in SQL 2008 is a tricky. you need to put the files in the Data folder that was created when you first installed SQL 2008. if you try to put the these files in a separate folder, you will get the read-only error message.

    i tried to give the logon account of the MSSQLSERVER service administrative rights and also it did not work.

    Follow the following steps to attach 2000 DB in 2008:

    1. Copy both mdfs and ldfs to the folder

    C:\program files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA

    "Do not select the reporting service folder MSRS10.MSSQLSERVER"

    2. Run SQL Management Studio, right click on Database node, and select Attach...

    3. In the attach database window, browse to the folder as in step 1 above.

    4. Select the .mdf file, automatically the window will be filled with other details of the other ndfs and ldfs.

    5. It is very important that you check the actual file path of each these files and correct to map to DATA folder that contains these files.

    6. click OK and the database is attached without any error...

    One important note; if you checked the properties of this attached DB, and selected options from the left side, you will find that the compatibility level is set to SQL Server 2000 (80)... change it to SQL SERVER 2008 (100), and click OK. This way you will make this DB completely migrated to 2008.

  • thanks for the replay, actually i made a mistake saying that the mdf file is of Sql server 2000, the mdf file am trying to attach is of sql 7.0 and not sql server 2000. Sorry for that

  • SQL Server 2008 has backward compatibility with SQL server versions 2000 and 2005.

    I suggest you try to attach the SQL Server 7 DB files in 2000 first and then follow the steps mentioned in earlier post.

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply