Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 AdventureWorks Database

Author  Topic 

noquintic
Starting Member

10 Posts

Posted - 2007-06-03 : 18:02:01
I am unable to attach the AdventureWorks database in management studio. I installed it when I installed SQL Server 2005 but can not find the mdf or ldf files anywhere. When I inserted the installation disks again to do a custom instal, and selected AdventureWorks, the response came back that it was already installed. What do I need to do to be able to attache this db in the management studio?

Many thanks in advance for your help.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-06-03 : 20:08:54
Did you see it under databases in ssms?
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-06-04 : 01:30:25
perhaps the mdf/ldf are on the file system but they are not attached?

search your filesystem for AdventureWorks_Data.mdf


www.elsasoft.org
Go to Top of Page

noquintic
Starting Member

10 Posts

Posted - 2007-06-04 : 07:28:54
I did not see it under databases in ssms. I searched the file system for anything ending in .mdf and found nothing named Adventureworks, Adventure_works, Adventure anything. Could it have been installed as a .zip file with some other name?

I went to http://technet.microsoft.com/en-us/library/ms143758.aspx and ran the script to reinstall. All is well... for now.
Thanks all.
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2007-06-04 : 12:11:10
You can download a seperate file from the micorsoft web site to install the adventure works DB this will attach it automatic instead of searching high and low on you pc to find out where its been placed
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2007-06-04 : 13:09:13
try this link

http://www.microsoft.com/downloads/details.aspx?familyid=e719ecf7-9f46-4312-af89-6ad8702e4e6e&displaylang=en
Go to Top of Page

douban
Starting Member

3 Posts

Posted - 2007-07-27 : 02:17:52
I have Same Problem Here........
but i found AdventureWorks_Data.mdf
how can i import adventureworks database into managment studio >>>>>>>>???
thanks alot >>>>>>>>

Eng.Ahmed Douban
MCSE, MCSA, MCDST, CCNA
Go to Top of Page

douban
Starting Member

3 Posts

Posted - 2007-07-27 : 02:36:25
sorry i found the solution

Attach the AdventureWorks database.

1. In the Object Explorer, right-click on the Databases folder, and click Attach.
2. In the Attach Database(s) dialog box, click Add.
3. Locate and select the following master file for the AdventureWorks database (C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf), and click OK.
Note that the Attach Database dialog box is not modal. This means that you can go back to the Management Studio and look for other information you might require while filling in the dialog box.
4. Verify that there are two files listed in the AdventureWorks database details section in the bottom half of the Attach Database(s) dialog box.
5. Click OK to attach the database.

Regards...........

Eng.Ahmed Douban
MCSE, MCSA, MCDST, CCNA
Go to Top of Page

noquintic
Starting Member

10 Posts

Posted - 2008-01-18 : 10:36:42
quote:
Originally posted by douban

sorry i found the solution

Attach the AdventureWorks database.

1. In the Object Explorer, right-click on the Databases folder, and click Attach.
2. In the Attach Database(s) dialog box, click Add.
3. Locate and select the following master file for the AdventureWorks database (C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf), and click OK.
Note that the Attach Database dialog box is not modal. This means that you can go back to the Management Studio and look for other information you might require while filling in the dialog box.
4. Verify that there are two files listed in the AdventureWorks database details section in the bottom half of the Attach Database(s) dialog box.
5. Click OK to attach the database.

Regards...........

Eng.Ahmed Douban
MCSE, MCSA, MCDST, CCNA




When I follow the instructions above, I get the following message:
=============================================
TITLE: Microsoft SQL Server Management Studio
------------------------------
Attach database failed for Server 'AHC-3R20T91'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
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 10, 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
------------------------------
===========================================
After consulting the release notes here:
http://www.codeplex.com/SqlServerSamples/Wiki/View.aspx?title=SQLServerDatabasesandSamplesOverview&referringTitle=Home

I run this query:
exec sp_attach_db @dbname = N'AdventureWorks',
@filename1 = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf',
@filename2 = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'

and always get this response:
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 10, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.

I think that my login may not have admin rights to create a database. How do I tell the rights and permissions for this login?

Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-01-20 : 20:42:02
Where did you get those files?
Go to Top of Page
   

- Advertisement -