Skip to content

Attach StackOverflow Database to SQL Server

All my demos will use the StackOverflow database. You can download the StackOverflow database (I use the Small version) on Brent Ozar’s blog here. Once downloaded, follow the steps below:

  1. Unzip the files using 7Zip.
  1. Open SQL Server Management Studio, connect to the desired instance, right click on Databases, and click Attach
  1. Click Add
  1. Copy the path and open the folder in File Explorer
  1. Copy the files StackOverflow2010.mdf and StackOverflow2010_log.ldf and paste them into the folder in the above screenshot
  1. Go back into SQL Server Management Studio, and close the window Locate Database Files. Click Add on the Attach Databases window, select StackOverflow2010.mdf, and click OK.
  1. Click OK.
  1. Go to Object Explorer and notice the database StackOverflow2010 is now added.

You’re done!

Leave a Reply

Your email address will not be published. Required fields are marked *