Error 602: the row corresponding to index Id 1 of Object ID 1 in Database ID 7 cannot be found in sysindexes. Run DBCC checktable on sysindexes
When learning Asp.net, I often need to attach other people's databases (*. MDF files in the appdata directory) to my
In SQL Server, the following errors often occur when I use "all tasks --> attach:
Error 602: the row corresponding to index id1 of object id1 in database id11 cannot be found in sysindexes. Run the command on sysindexes
DBCC checktable.
Why am I depressed ??????
Answer:
In this case, first check the development environment (such as vs2005 + sql2005) indicated by the source code on 51aspx ), if you use sqlserver2005, this error will occur when you use SQL2000 to append the sql2005 database (solution: Use sqlserver2005 to append it, if you want to use the SQL2000 format, use the export SQL statement and other methods for conversion)
Csdn Solution
Direct restore or attaching should not work, and it is certainly no problem to use script + to export data.
2005 to 2000 steps
1. Generate database scripts for version 2000
Manger studio of 2005
-- Open "Object resource manager" (if not, press F8) to connect to your instance
-- Right-click the database to go to 2000
-- Task
-- Generate scripts
-- In the "select database" in the "script wizard", make sure that the selected database is to be transferred to 2000.
-- Select "write scripts for all objects in the selected Database"
-- In the next "select script options", find the "write script for server version" option and select "SQL Server 2000"
-- Set other options as needed
-- Finally, save the script to A. SQL script file.
2. Create the target database in 2000
In the query analyzer (or 2005 manger studio opens the script file), connect to SQL Server 2000 and execute the script generated above to create a new database.
3. import data from 2005 to 2000
Manger studio of 2005
-- Open "Object resource manager" (if not, press F8) to connect to your instance
-- Right-click the database to go to 2000
-- Task
-- Export data
-- In the "Select data source" step of the "SQL Server Import and Export wizard", select the database to be exported.
-- In the "select target" step, connect to 2000 and select the library created in step 2.
-- In "select source table and source View", select all tables
-- Final Completion