Ent. Manager Attach db error 602

  • Hi

    On my machine I had an SQL 2000 default instance (developer edition) then installed SQL 2005 named instance. This instance was corrupted and tried to repair then uninstall. After that my SQL 2000 was corrupted so I installed it again.

    When I try to attach any db I get: SQL-DMO (ODBC SQLState: HY000), Error 602: Could not find row in sysindexes for database ID 7, object ID 1, index ID 1. Run DBCC CHECK TABLE on sysindexes.

    I need help to recover my data.

  • Looks like db was not detached properly, if you have the previous backup restore it ro you can Try attaching through QA using sp_attach_db or sp_attach_db_single_file...

    MohammedU
    Microsoft SQL Server MVP

  • QA attach did not work as well.

  • Looks like your mdf file is corrupted...

    Try the following if you can get the data..

    1. Rename existing mdf file mdf_old

    2. Create new database with the same as corrupted database with same file names.

    3. Stop sql service.

    4. Rename mdf and ldf of new database files to mdf_new and ldf_new

    5. Rename mdf_old to mdf

    6 Start the sql service.

    7. you may see your db in suspect mode.

    8. Run sp_resetstatus command if didn't work update the sysdatabase table make db to emergency mode.

    9. If you are lucky you take your data out using dts or bcp..

     

    MohammedU
    Microsoft SQL Server MVP

  • I worked around the problem by attaching to SQL 2005. I cannot explain how.

    Thanks

  • You can't attach a SQLsrv2005 DB File on a SQLsrv2000.

  • johan.kitti (12/4/2008)


    You can't attach a SQLsrv2005 DB File on a SQLsrv2000.

    And what Johan meant was that the original error you got was nothing to do with the database being corrupt, as Mohammed suggested - it's the error you get when you try to attach a 2005 database to a 2000 instance.

    Databases cannot be attached down-level.

    Thanks

    Paul Randal
    CEO, SQLskills.com: Check out SQLskills online training!
    Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
    SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
    Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005

  • And it doesn't matter if you've kept the database on 80 compatibility level on SQL Server 2005. Once you attach it (or restore ) it to 2005 (or 2008), it is converted to that format physically, no matter what the setting.

    You can script out and move the schema/data back to 2000 with DTS/SSIS or something like SQL Compare.

Viewing 8 posts - 1 through 7 (of 7 total)

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