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

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is this a SQL 2005 database? Are you trying to reattach it to 2000? That won't work if so.
Aneesh RetnakaranDatabase AdministratorCommented:
You can't restore a SQL 2005 DB in SQL server 2000
Ain't that what I said. And we're not sure that's what he's doing.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Aneesh RetnakaranDatabase AdministratorCommented:
I just wanna stress that point :)
Are you truly trying to restore this database, or are you trying to attach it?
musclejackAuthor Commented:
no  iti s 2005.  Anyone?  serious answers please
The answers are serious answers, are you trying to restore this database or attach it?
musclejackAuthor Commented:
attach it.
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:
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).
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)
musclejackAuthor Commented:
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
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.
Aneesh RetnakaranDatabase AdministratorCommented:
> 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
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.
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..
musclejackAuthor Commented:
Hi, i reinstall 2005 with a new named instance, but still point to 8.00.2039, how to switch it. thx
What is still pointing to the 2000 instance? Are you using Maintenance Studio? Have you connected to the new instance?
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)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.