Sunday, February 28, 2016

Sample Database for "What Every Developer Should Know About SQL Server Performance"

To download the sample database for 'What Every Developer Should Know About SQL Server Performance", use the link below that corresponds to your version of SQL Server.



Once you have the file downloaded, unzip the file.  Then, in SQL Server Management Studio, right click on the databases folder and select "Restore Database".  In the dialog box, choose "Device" and locate the "Students.bak" file you just unzipped.  Follow the prompts and the database will be restored to your system.

Using bcp to Import Data Instead

If you have trouble with the backup file, or just prefer to import your data directly, I've put together a zip file of the raw data exported out using the SQL Server bcp utility.  In this file, I have a readme.txt file that tells the exact steps to bring the data in, but basically, you will do the following:

  1. Go into Management Studio and create a new database called Students.
  2. Run the included Students-Schema.sql file in Management Studio to create all of the schema objects (tables)
  3. At a command prompt, run a series of bcp commands to bring the data into SQL Server.  In the file, there is a list of all the commands you need to run in the correct order.  
The link to the bcp file is here: Students Data as bcp Export


Either way, the result is to same, the data will get into your database and give you an opportunity to play around.

13 comments:

  1. Hi -

    No bak file for sql server 2008.
    Can you please look into it.

    Thanks,
    Anirban

    ReplyDelete
  2. Hi,
    When restoring database on sql server 2008, getting the error "Specified cast is not valid. (SqlManagerUI)"

    Any help appreciated..

    Thanks,
    Amar

    ReplyDelete
  3. Thank you for making this available. However, When I try to restore it to 2008 R2, I get the error message "Object cannot be cast from DBNull to other types. (mscorlib)".

    Would appreciate any guidance.

    Thanks

    ReplyDelete
  4. I just noticed that all the links point to the same file, which is the 2014 version. I'm sure once those links are fixed it will work fine.

    ReplyDelete
  5. Hello all,
    I've updated the links for SQL 2012 and 2008 so they point to the correct backup files now. Make sure to grab the appropriate file for the version of SQL you have otherwise you will run into problems during the restore process.

    Thanks,
    David

    ReplyDelete
  6. After clicking on the SQL Server 2012 link above, I am told that the security certificate for the website is being used by another website, and I am not allowed to continue. Is there another way to get the sample db?

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. Restore your Entire Database with Cognegic's Simple DB Recovery Support
    Feeling stressed? Due to by mistakenly deletion of your database? If yes, by then consider our extraordinary among other help i.e. DB Recovery Support or Exchange Database Recovery. Here we give complete Backup Recovery of your entire database including MongoDB, Cassandra, MySQL, and MS SQL Server and so on. Here we will help you to examine, screen and check the execution of your database and give high-availability and streamline your database. You can particularly contact to our specific pros and request your inquiries.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete
  9. Nice Blog, When i was read this blog i learnt new things & its truly have well stuff related to developing technology, Thank you for sharing this blog.
    iPhone app training course in bangalore
    iPhone job oriented course in bangalore
    Best iphone training institute bangalore
    iOS course fee in bangalore

    ReplyDelete
  10. Thanks for sharing the valuable information. Your article gave me a lot of information. We at Techno Data Group would like to introduce to you about our organization. We are the leading database providers for b2b marketing across the globe. we provide you with the readymade as well as the personalized email list and connect you with the right client or decision-makers. Please refer our Technology Mailing List for further details.

    ReplyDelete
  11. Thanks for sharing nice information with us. i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. Email lists

    ReplyDelete