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
musclejackAsked:
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.

Atlanta_MikeCommented:
Is this a SQL 2005 database? Are you trying to reattach it to 2000? That won't work if so.
0
Aneesh RetnakaranDatabase AdministratorCommented:
You can't restore a SQL 2005 DB in SQL server 2000
0
Atlanta_MikeCommented:
Ain't that what I said. And we're not sure that's what he's doing.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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

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
lethuanCommented:
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
kkkaniCommented:
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
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.