Answered Can SQL Server 2008 access Northwind or Pubs databases?

  • 13 มีนาคม 2552 0:04
     
     

    I've installed SQL Server 2008 Express with Advanced Features, but I've been having so-far insurmountable problems installing the AdventureWorks sample databases. However, I've successfully installed the Northwind sample databases, and I've downloaded the installer for the Pubs sample databases, so:

     

    Can SQL Server 2008 access Northwind or Pubs databases?

     

ตอบทั้งหมด

  • 13 มีนาคม 2552 3:21
    ผู้ดูแล
     
     คำตอบที่เสนอ
    Absolutely.
    Aaron Alton | thehobt.blogspot.com
  • 13 มีนาคม 2552 3:27
     
     
    It doesn't involve any file conversion? The Northwind database is .mdb files.
  • 13 มีนาคม 2552 3:32
    ผู้ดูแล
     
     
    If you're attaching SQL 2000 data files to SQL 2008, they will automatically be converted to 2008's file format.  Just keep in mind that you can't then reattach the same files to SQL 2000.

    Give it a shot and let me know how you fare.

    Aaron Alton | thehobt.blogspot.com
  • 13 มีนาคม 2552 3:46
     
     
    I'm new to this, so spell it out for me: does this mean that because SQL Server 2000 can access Northwind and Pubs databases, SQL Server 2008 can too (and they'll automatically be converted to SQL Server 2008 format)?
  • 13 มีนาคม 2552 4:06
    ผู้ดูแล
     
     
    Yes.  Each version of SQL Server has a corresponding data file format.  When you attach a database to SQL 2008 (using sp_attach_db, or right-click on Databases > Attach in SQL Server Management Studio), the file will be converted to 2008 format.  The reverse isn't true - because 2000 isn't aware of 2008 file formats, it can't do anything with 2008 files.

    Make sense?
    Aaron Alton | thehobt.blogspot.com
  • 13 มีนาคม 2552 4:25
     
     

    It's just that a guy at another forum told me:


    "What KIND of databases are they???

    If they are ".mdb" (Access) files, then SQL Server is the wrong tool to use.

    If they are ".dbf" files or if you installed by importing into a SQL Server DB, then of course you can use SQL Server to access them."


    As I said above, these Northwind files are .mdb's.

     

  • 13 มีนาคม 2552 4:41
    ผู้ดูแล
     
     
    Ha - I missed that.  Yes, mdb is Access.  SQL Server isn't dbf - it's default data file extension is mdf. 

    Use Northwind or pubs from here:
    http://www.microsoft.com/Downloads/details.aspx?FamilyID=06616212-0356-46a0-8da2-eebc53a68034&displaylang=en

    Aaron Alton | thehobt.blogspot.com
  • 13 มีนาคม 2552 4:51
     
     

    Now I'm thoroughly confused.

    >Ha - I missed that.  Yes, mdb is Access.

    This seems to indicate: "No, it won't work."

    >SQL Server isn't dbf - it's default data file extension is mdf.

    To me, this strongly seems to indicate that it will work.

    Did you mean that SQL Server is dbf, not "isn't'?

  • 13 มีนาคม 2552 4:59
    ผู้ดูแล
     
     

    Nope - I got it right this time ;)

    Access > mdb
    SQL Server > mdf
    DBase > dbf


    Aaron Alton | thehobt.blogspot.com
  • 13 มีนาคม 2552 5:40
     
     
    Does this mean I don't have to import the Northwind database into SQL Server 2008 - I can just attach it to my SQL server?
  • 13 มีนาคม 2552 14:55
     
     คำตอบ
    Bob, that's true (you can just attach it) if and only if it's an MDF/LDF pair. You can just download the ZIP file that has the T-SQL script in it from here: http://code.msdn.microsoft.com/northwind. That will create and populate Northwind and/or pubs on just about any version of SQL Server from 2000 and up.
    David Reed - MSFT - Microsoft Certified Architect|SQL Server - http://blogs.msdn.com/reedme/
    • ทำเครื่องหมายเป็นคำตอบโดย David Reed - Glacier Peak 13 มีนาคม 2552 14:56
    •  
  • 13 มีนาคม 2552 16:50
     
     
     >"...if and only if it's an MDF/LDF pair."

    As Bill Nurray said in Ghostbusters: "Let's pretend that I'm NOT an expert in medieval metallurgy..."

    What two elements might constitute this hypothetical MDF/LDF pair?

    And just what the hell is an MDF/LDF pair?

    And how would I know if the afore-mention pair is of the MDF/LDF persuasion?

    Which is not to imply that I'm ungrateful for your help.

    It's just that frankly, I'm baffled. The immensely diverse range of answers I've received to this question and related questions in the various forums is truly mindboggling.

    But I'll keep trying, if you will.
  • 14 มีนาคม 2552 4:37
    ผู้ดูแล
     
     
    It's a pair of files - one with an "mdf" extension, and one with an "ldf" extension.

    SQL Server uses data files and log files to make up each "database", so in order to have a complete "database", you either need to have both an mdf and an ldf (or more, but let's keep it simple), or a backup file.  Technically, they can have any file extensions, but mdf, ldf, and .bak for backup files are all standard and generally accepted extensions.
    Aaron Alton | thehobt.blogspot.com
  • 16 มีนาคม 2552 16:32
     
     
    BobLewiston said:

     >"...if and only if it's an MDF/LDF pair."

    As Bill Nurray said in Ghostbusters: "Let's pretend that I'm NOT an expert in medieval metallurgy..."

    [snip]

    But I'll keep trying, if you will.

    No problemo! Love the Ghostbuster's quote.

    As Aaron said, those are files. SQL Server needs a data file (MDF) and a log file (LDF) @ a minimum for each database.

    As for metallurgy, let's start @ the beginning. Here's the getting started point in Books Online (BOL): http://msdn.microsoft.com/en-us/library/bb500434.aspx

    If you uninstall AdventureWorks from the Control Panel (was it still called Add/Remove Programs in XP? I've been using 7 lately and it's more like Vista in control panel applet names)... then we can start from scratch.

    Here's what I would do with a suspect system:

    1. Close all the open programs and shutdown all the services I could.
    2. Nuke everything in %TEMP% and %WINDIR%\Temp\ just to remove all the cruft.
    3. Empty the recycle bin.
    4. Defrag the HDD (yeah, it sounds silly, but i/o is the principle barrier that SQL Server usually runs into).
    5. Open a command prompt and run CHKDSK /F on the drive where you'll be installing to. It'll ask you if you want to schedule a reboot, since the drive is in use.
    6. Reboot the box and watch the CHKDSK run for errors.
    7. Make sure all the SQL Services are running.
    8. Open command prompt and run the MSIEXEC command from above.

    If it doesn't succeed in ~10 to ~20 minutes (depending on the speed of your HDD), then we can check Task Manager and see what kind of resource utilization we're experiencing. If the system is essentially idle, then the script execution is hung or SQL Server is having trouble allocating space for the databases for some as yet undetermined reason.

    If we're still having trouble at this point, we'll be digging into the event logs and the SQL Server error logs, and maybe having some fun with Profiler.


    David Reed - MSFT - Microsoft Certified Architect|SQL Server - http://blogs.msdn.com/reedme/
  • 18 มีนาคม 2552 20:40
     
     
    Hello,

    Rather than start a new thread, I'll just post here...and see if anybody answers. 

    Below is my problem. I cannot get my version of SQL Server 2005 to run AdventureWorks (latest version, the "light" version, which apparently was generated in December 2006 if I'm not mistaken).

    Two workarounds (assuming I'm correct):  first, find an old copy of AdventureWorks that will run on SQL Server 2005.  But I notice the link for this, on this site, has been discontinued or deprecated.  Second, upgrade to SQL Server 2008, which can work side by side with 05.  But is there a third way?

    RC

    Seems like AdventureWorks only is supported by SQL Server 2008 now...

    see this error message (running SQL Server 2005 from inside of Visual Studio 2008 under Vista):

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    The database 'C:\USERS\USER\DOCUMENTS\ADVENTUREWORKS 2008 LT\ADVENTUREWORKSLT2008_DATA.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.

    Could not open new database 'C:\USERS\USER\DOCUMENTS\ADVENTUREWORKS 2008 LT\ADVENTUREWORKSLT2008_DATA.MDF'. CREATE DATABASE is aborted.

    An attempt to attach an auto-named database for file C:\Users\USER\Documents\AdventureWorks 2008 LT\AdventureWorksLT2008_Data.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
    ---------------------------
    OK
    ---------------------------
  • 19 มีนาคม 2552 16:33
     
     คำตอบ
    Howdy, Ron. The Yukon versions of AdventureWorks are still available on CodePlex: http://sqlserversamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=4000

    Also, upgrading to 2008 would solve that problem, too.
    David Reed - MSFT - Microsoft Certified Architect|SQL Server - http://blogs.msdn.com/reedme/
    • ทำเครื่องหมายเป็นคำตอบโดย David Reed - Glacier Peak 19 มีนาคม 2552 16:33
    •  
  • 20 มีนาคม 2552 0:02
     
     
    David Reed or anybody:

    I tried to download this link, and it worked, but now I find I cannot run scripts since SQL Server 2005 scripting tool is not installed, so the database is of no use (not populated) ... (though, strangely enough, I am able to get Visual Studio 2008 version SP1 to run, and have successfully loaded up and programically interacted (using C#) with the "NorthWind" database.

    I was not able BTW to install SQL Server 2008 Express edition despite my best efforts (for some reason it choked at the very end, saying a certain SP was not installed, though it already is; I'll keep working on it but it does not look good)

    So please tell me:

    1) should I install SQL Server 2005 Express edition?

    2) can you or anybody please FTP the built/populated AdventureWorks (Yukon, i.e. 2005 version) database?  Even email it to me would be fine.  I am simply trying to access it from inside Visual Studio 2008, and, like I say, I'm able to access the NorthWind dB without a hitch.  This second option I would greatly prefer, since I hate having to install SQL Server too many times (in theory it's not a problem, but in practice I have a feeling it might start conflicting with whatever SQL Server is built into Visual Studio 2008.

    BTW I'm running Vista OS on a Core 2 Duo.

    RC
  • 20 มีนาคม 2552 1:19
    ผู้ดูแล
     
     
    The scripting tool - do you mean SQL Server Management Studio Express?  You should install that if you don't already have it installed.  It's been a while (three years or so ;-0) since I installed the 2005 samples, but to the best of my knowledge you did not require SSMS in order to install.  Are you receiving any particular error?
    Aaron Alton | thehobt.blogspot.com
  • 20 มีนาคม 2552 2:12
     
     
     The scripting tool - do you mean SQL Server Management Studio Express?  You should install that if you don't already have it installed.  It's been a while (three years or so ;-0) since I installed the 2005 samples, but to the best of my knowledge you did not require SSMS in order to install.  Are you receiving any particular error?

    AA--thanks.  A quick update: I foolishly installed SQL Server 2008 Express overriding the SQL Server 2005 (Developer Version) and like I figured it essentially ruined ADO.NET while inside Visual Studio 2008--no dB is accessible now from inside of VS08 (times out).  Luckily the other parts of VS08 work insofar as I can tell.  In a nutshell I needed a SP but the SQL S08 express installation did not abort (I found out later)--a clear error by Microsoft regarding installation.  Since this is not a forum for install, I'll spare you the details and simply state that tomorrow I will reinstall SQL Server 2005.  I will also install the SSMSE that you mentioned--this was in fact what I should have done had I seen your reply in time.

    Long story short:  never, ever mess with a stable system! LOL, I did use a restore point to go back, but failed to do a system restore of the entire (ghosted) HD for a variety of reasons (principally I don't think Vista Ultimate Backup tool works right--at least I could not see how to go back as I can in my other XP system using Symantic Ghost).

    Thanks for your help.

    RC
  • 23 มิถุนายน 2554 22:25
     
     
    Thank you  for the information!!!!!!!!!!!
  • 22 พฤศจิกายน 2555 11:34
     
     คำตอบที่เสนอ