I could not locate the AdventureWorks database that I downloaded

问题 I could not locate the AdventureWorks database that I downloaded

  • Wednesday, September 23, 2009 11:46 PM
     
     
    I am new to SQL server. I downloaded SQLserver2008 Enterprise Evaluation on my Windows Vista laptop. I also downloaded the 2008 AdventureWorks and AdvantureWorks DW. The downloading process seemed smooth enough. But, I couldn't find any AdventureWorks related database in the Management Studio, nor the BI studio.  The only traces I found about AdventureWorks are a bunch of files in the following directory:
    C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA
    Can any one help please?

All Replies

  • Thursday, September 24, 2009 3:58 PM
    Moderator
     
     
    If the installation had actually been successful the AdventureWorks2008 databases would already be attached to your instance of SQL Server 2008.  So, let's assume that the installation failed.  Please perform the following steps:

    1.  Read the prerequisite information for installing the sample databases and (http://msftdbprodsamples.codeplex.com/Wiki/View.aspx?title=Database%20Prerequisites) and follow all instructions.

    2. Read and follow the installation instructions for installing the sample databases: http://msftdbprodsamples.codeplex.com/Wiki/View.aspx?title=Installing%20Databases

    3.  Assuming you do not see any error messages during the installation process, you should be able to open SQL Server Management Studio and see the AdventureWorks databases in the Databases folder of Object Explorer.  Alternatively, you can run the query SELECT * FROM sys.databases and it should list these databases.


    The other alternative is that you downloaded the older version of AdventureWorks and not AdventureWorks2008.  In this case, you must manually attach the database files.  You can tell the difference between the two versions by looking at the filenames.  AdventureWorks2008 will have 2008 in the filename, the older version will not (e.g. AdventureWorks2008_data.mdf or AdventureWorks_data.mdf).  If it's the older version that you have downloaded, you can simply attach it. See this Books Online topic for instructions: http://msdn.microsoft.com/en-us/library/ms190209.aspx.

    Kind regards,
    Gail
    Gail Erickson [MS] This posting is provided "AS IS" with no warranties, and confers no rights
  • Thursday, September 24, 2009 8:44 PM
     
     

    Thanks Gail for the fast reply.

    I am sure it is the 2008 version.

    I checked the pre-requisites since I have been struggling with this for a few days by trying different things including uninstalling
     and installing, restarting computer many times :-(( All three pre-requisites were met, I ran the suggested New Query anyway.

    Thanks for the installation instruction link. I installed x84, would it make any difference? I found  lots of data about AdventureWorks2008 in the following directory though.

    C:\Program Files\Microsoft SQL Server\100\Tools\Samples

    Thanks in advance for further help

  • Thursday, September 24, 2009 10:59 PM
    Moderator
     
     

    Okay, so let's try to figure out what you've really got at this point.  

    From the folder  C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA , do you see files like AdventureWorks2008_Data.mdf and AdventureWorksDW2008_Data.MDF?  The file sizes should be roughly 195 MB and 70 MB respectively.

    If you have these files, try to attach the databases following the instructions here:  http://msdn.microsoft.com/en-us/library/ms190209.aspx.


    If you don't have those files, then try the following steps to run the installation script.

    From a command prompt, enter the following text as shown:
    sqlcmd -i "C:\Program Files\Microsoft SQL Server\100\Tools\Samples\AdventureWorks 2008 OLTP\instawdb.sql"


    Regards,
    Gail


    Gail Erickson [MS] This posting is provided "AS IS" with no warranties, and confers no rights
  • Friday, September 25, 2009 10:14 PM
     
     
    Thanks, Gail:

    I do have those files. And I tried Attach and ended up with error 'SQL server error 5123".  Any clue?

    Also, in the same path, there is an AdventureWorks_data.mdf (2005 version?)  together with AdventureWorks2008 _data.mdf. The same for the DW and LT databases. Is this normal?  There used to be a SQL server 2005 on the laptop. Not sure if they are the leftover after I uninstalled the 2005? Advice?

    Thanks again.

  • Friday, September 25, 2009 10:47 PM
    Moderator
     
     
    Yes, AdventureWorks_data.mdf is the 2005 version.  You should be able to attach that database. It does not have the prerequisites (Filestream and full-text) that the 2008 version does.

    Would you please  run the following statements from Management Studio and report back the results?

    SELECT * FROM sys.databases

    SELECT @@VERSION

    Thanks,
    Gail
    Gail Erickson [MS] This posting is provided "AS IS" with no warranties, and confers no rights
  • Friday, September 25, 2009 11:02 PM
     
     

    I tried to attach the 2005 version. The same error. Should I get rid of these 2005 version files or it is OK for them to stay, or they are supposed to be there?

    Here is the result of the SELECT statments:

    master
    tempdb
    model
    msdb
    SQL2008SBS
    SQL2008SBSFS

    The last two databases were the ones that I created, you know, part of my learning curve.

    Thanks

  • Friday, September 25, 2009 11:09 PM
    Moderator
     
     
    What about the results of SELECT @@VERSION?
    Gail Erickson [MS] This posting is provided "AS IS" with no warranties, and confers no rights
  • Friday, September 25, 2009 11:12 PM
     
     
    Is this what you are asking?

    Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86)   Jul  9 2008 14:43:34   Copyright (c) 1988-2008 Microsoft Corporation  Enterprise Evaluation Edition on Windows NT 6.0 <X86> (Build 6000: )
  • Friday, September 25, 2009 11:25 PM
    Moderator
     
     

    Yes,  It just verifies that you're connecting to an instance of SQL Server 2008 and not a lower version.

    I did a little research and discovered that the error you're getting (5123) can be caused by lack of permissions, especially with Vista.

    Here are couple of things to try:

    Turn off User Account Control or run Management Studio as Administrator (Right Click on the menu and use "Run as Administrator" to
    open the program>

    or

    Check the security settings on the files (and the folder) to make sure the account you're using has write permissions

    See this thread (http://www.ureader.com/msg/11621557.aspx)  for more information.

    Gail


    Gail Erickson [MS] This posting is provided "AS IS" with no warranties, and confers no rights
  • Sunday, October 11, 2009 10:54 PM
     
     
    Hi, Gail:

    It has been a while before I can come back to work on this problem again. It was solved just as you suggested. I was able to attach the database as the administrator. Thank you for keeping me going on this. I was about to give up before you started helping me.

    Thanks again.