?
Solved

Could not find row in sysindexes for database ID 7, object ID 1, Run DBCC CHECKTABLE on sysindexes.

Posted on 2006-05-31
21
Medium Priority
?
15,649 Views
Last Modified: 2011-08-18
Got this error when I tried to restore AdventureWorks sample db

Could not find row in sysindexes for database ID 7, object ID 1, Run DBCC CHECKTABLE on sysindexes.

COuld not open new database 'AdventureWorks'.  CREATEDATABSE is aborted (Microsoft SQL Server, Error:602)

any ideas how to fix it? thx
0
Comment
Question by:musclejack
  • 9
  • 4
  • 3
  • +4
21 Comments
 
LVL 13

Expert Comment

by:Atlanta_Mike
ID: 16800654
Is this a SQL 2005 database? Are you trying to reattach it to 2000? That won't work if so.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16800675
You can't restore a SQL 2005 DB in SQL server 2000
0
 
LVL 13

Expert Comment

by:Atlanta_Mike
ID: 16800701
Ain't that what I said. And we're not sure that's what he's doing.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16800714
I just wanna stress that point :)
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800741
Are you truly trying to restore this database, or are you trying to attach it?
0
 

Author Comment

by:musclejack
ID: 16800742
no  iti s 2005.  Anyone?  serious answers please
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800755
The answers are serious answers, are you trying to restore this database or attach it?
0
 

Author Comment

by:musclejack
ID: 16800768
attach it.
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800784
Well if you are definitely attaching it to SQL Server 2005, and not accidentally connecting to a SQL Server 2000 machine that error should not be occuring.

Try and download the Adventureworks sample database again and follow the instructions on the link:

http://www.microsoft.com/downloads/details.aspx?FamilyID=e719ecf7-9f46-4312-af89-6ad8702e4e6e&DisplayLang=en
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800797
It may be that your MDF is corrupt somehow.. But get the latest files from that linke, follow the instructions on the page and let us know what happens after doing that.

Make sure that the drives being used are accessible to SQL Server, make sure the SQL Server service account has permissions on the drive, and double check to make sure you are connecting to a SQL 2005 server (if you have SQL 2K in you environment and use SSMS to attach to both environments, it is easy to make that mistake).
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800807
Also - you only want the adventure works sample DB files at this point ,so just download those..

x86 if you are on 32bit OS (more likely)
x64 if you are on 64 bit (less likely)
0
 

Author Comment

by:musclejack
ID: 16800815
Mike, on the MSM, it said localhost 8.00.2039, not 9.00....

i have sql server 2000 and 2005 on the same machine, how can i fix it without reinstall sql server 2005, thx
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800836
So you are connecting to the SQL 2000 machine. When you instaleld 2005 it asked you for a named instance? Connect to that named instance.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16800858
musclejack,
> how can i fix it without reinstall sql server 2005

I think you installed without creating a new sql server instance ,

You need to reinstall the sql server 2005. ( presently it uses the sql server 2000).. But remember to put another instance instead of the default instance
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800864
SQL Server 2000 and 2005 can coexist on the same server, but the second installation would  need a named instance unless the first already was a named instance.
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 16800870
or he could be connecting to the wrong instance, aneesh. Before attempting a reinstall let's first see if he has installed a named instance of 2005 first..
0
 

Author Comment

by:musclejack
ID: 16801704
Hi, i reinstall 2005 with a new named instance, but still point to 8.00.2039, how to switch it. thx
0
 
LVL 27

Expert Comment

by:ptjcb
ID: 16801895
What is still pointing to the 2000 instance? Are you using Maintenance Studio? Have you connected to the new instance?
0
 
LVL 13

Accepted Solution

by:
MikeWalsh earned 2000 total points
ID: 16802199
You need to connect to "Servername\NamedInstance"

you are connecting to "Servername" from the sounds of it (assuming that SQL 2000 is a default instance)
0
 

Expert Comment

by:lethuan
ID: 20533067
When attaching a database that was detached from another SQL Server instance.

I got the error message below:

Error 602: Could not find row in sysindexes for database ID 25, object ID 1,
index ID 1. Run DBCC CHECKTABLE on sysindexes.

 i am using SQL Server 2005

Thanks and Regards
0
 

Expert Comment

by:kkkani
ID: 24649484
I am trying to attach mdf file (2005), using sql server management studio. and i have sql server 2000 on my machine. I am getting this error.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question