Friday, March 9, 2012

Error When Attaching Database

Hello Everyone,

I am very new to SQL and just completed an install of SQL 2005 Express. After install, I downloaded the Adventure Works database and attempted to attach through both the Object Browser (right-click 'Databases'>'Attach') and by running the script that is located on the SQL download page where I got the Adventure Works db.

Here's the error that I get:

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

I have attempted to go through the help files, but unfortunately the above message is too cryptic for me and I have no idea what it's telling me.

Can someone help?

Thanks!!

YOu can either use the attach method OR create the database with the scripts. There is no need to execute both, as they will end up both with a working Adventureworks database. I always prefer to execute the script as I am able to have a hand on the scripts first :-)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Thank you for the help, Jens.

For what it's worth, I mentioned in my post that I tried both methods of attaching the database because neither of them worked. However, I have discovered why they didn't work:

When I went the Visual Studio page earlier this evening, I chose to install the SQL Server Express Tools thinking that this would give me the total installation including the SQL database engine. Apparently I was wrong. When choosing this option, what I got was the Management Studio and the Business Intelligence Development Studio. I was further led into thinking that I had everything I needed because I currently have the trial edition of SQL Server 2000 Enterprise Edition installed (the books I use in my SQL class are written in ANSI 92 so we only use 2000)...i'm sure you can imagine what happened after opening Management Studio for the first time - I get a connection to my SQL 2000 server complete with all of the databases I had installed over there. VERY CONFUSING if I do say so myself.

What I ultimately had to do was go back to the Visual Studio Express site and download the SQL 2005 Express engine and then install a new named instance. After I did this, I was able to then download the Adventure Works database and attach it successfully.

Not bad for a newbie, eh?!

I have always found SQL confusing which is why I saved it for last in my studies. This is my opinion here so take it for what it's worth - but if Microsoft wants more hobbyists and folks who are curious about IT to download SQL Express, then they need to better clarify and explain the difference between the various download options and the absolute importance of installing the SQL Express engine first. I can just imagine some people out there getting very frustrated and giving up completely.

I hope this helps some folks.

Thanks!!

|||

Hi Dear,

I got the same problem while attaching my database. Actully I received mdf and ldf file which was created in sql 2005. But I was not aware of that. Reading your post help me.

Thanks a lot.

No comments:

Post a Comment