Friday, March 23, 2012

MS SQL Server 2005 -- Cant not attach to AdventureWorks Database

I have MS SQL Server 2005 installed and when trying to connect to AdventureWorks DB

Downloaded AdventureWorksDB.msi file and when trying to attach recieve this error when running script ?

Msg 1813, Level 16, State 2, Line 1

Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted.

Msg 602, Level 21, State 50, Line 1

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

Then tried to attach the DB and get this


TITLE: Microsoft SQL Server Management Studio

Attach database failed for Server 'JKIMBLE1'. (Microsoft.SqlServer.Smo)


ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Could not find row in sysindexes for database ID 8, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 602)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=602&LinkId=20476


BUTTONS:

OK

Is there a difference between MS SQL Server 2005 and SQL Server 2005 Express Edition

I am having the same problem. I've done some research, trying to fix this.

This thing is just curious because a coworker successfully installed the AdventureWorks DB and our computers are almost identical, HW and SW.

Anyone?
|||

Are you a server admin on the box where you are trying to attach the database? Or a local admin on the box?

There is no difference in the file format between the various editions of SQL Server 2005. This sounds like a rights problem to me.

|||Fortunately I solved my problem. The thing with me was that I had MSSQL Server 2000 installed on my machine. And when I opened the SQL Server Management Studio I used to connect to the instance of 2000 and not 2005. (e.g. LOCALHOST, instead of LOCALHOST\SQLEXPRESS)

Such a stupid thing, but I never read about it anywhere else.

I guess my problem was that there's no compatibility from 2005 to 2000.

Hope this works for you as well JKimble.
|||Thanks for the info...!! I had exact same issue - I downloaded AdventureWorks database and got the same error when I tried to attach to LOCALHOST but it worked Ok when I changed to LOCALHOST\SQLEXPRESS... NB: the same occurs for AdventureWorksDW database...|||

SteveSatriani wrote:

Thanks for the info...!! I had exact same issue - I downloaded AdventureWorks database and got the same error when I tried to attach to LOCALHOST but it worked Ok when I changed to LOCALHOST\SQLEXPRESS... NB: the same occurs for AdventureWorksDW database...

Two things AdventureWorksDW DB will not work with Express because there is no BI management studio and I know it was not created to work with 2000. But the OLTP AdventureWorks DB comes in both 2000 and 2005. Hope this helps.

No comments:

Post a Comment