Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to install an instance of SQL Server (it's not clear to me that you have done that). You can use the free <a href="http://msdn.microsoft.com/en-us/evalcenter/hh230763.aspx" rel="noreferrer">SQL Server Expres Edition</a> <em>unless</em>:</p> <ul> <li>the data file(s) consume more than 10GB</li> <li>the database uses features that require a higher SKU (Standard/Enterprise)</li> </ul> <p>We have no idea whether either of those conditions are true. If they are, then you can buy the <a href="http://rads.stackoverflow.com/amzn/click/B007RFXQAM" rel="noreferrer">Developer Edition for about $50</a> (feel free to shop around), assuming you are not planning to install this on a server and use it in production.</p> <p>I am suggesting SQL Server 2012 only because it is the latest supported release. You can choose to use SQL Server 2008 or any other version, but your best chance at compatibility with this backup file you've been given is if you are restoring it to a version that is <em>later</em> or equal to the version where it was backed up.</p> <p>This site is not the place for step-by-step instructions on installing an instance of SQL Server (<a href="http://msdn.microsoft.com/en-us/library/ms143219.aspx" rel="noreferrer">you can find those elsewhere</a>). Once you have an instance of SQL Server installed, then you need to find out what your database looks like. Usually your backup file will be created on a server where the database itself was installed in physical folders that do not match your own machine. So I suggest either finding out the default path by inspecting the output of this query (which tells you where the <code>master</code> data file is located):</p> <pre><code>SELECT physical_name FROM sys.master_files WHERE database_id = 1 AND [file_id] = 1; </code></pre> <p>Or creating a very simple folder called <code>c:\databases\</code>, giving the <code>Everyone</code> account modify privileges.</p> <p>Then run the following (below I've assumed the backup is in c:\databases\ and that's where you want the data files; if that differs, adjust accordingly):</p> <pre><code>RESTORE FILELISTONLY FROM DISK = 'c:\databases\whatever.bak'; </code></pre> <p>This will return a resultset like:</p> <pre><code>LogicalName PhysicalName ------------- ------------ Whatever C:\...\whatever.mdf Whatever_log C:\...\whatever_log.ldf </code></pre> <p>You need to build a <code>RESTORE DATABASE</code> command something like the following, based on the result above:</p> <pre><code>RESTORE DATABASE foo FROM DISK = 'c:\databases\whatever.bak' WITH MOVE 'Whatever' TO 'c:\databses\whatever.mdf', MOVE 'Whatever_log' TO 'c:\databases\whatever_log.ldf'; </code></pre> <p>Now you can connect to the database using Management Studio. The server name you specify in the connection dialog will depend on what edition of SQL Server you installed, and whether you used a named instance or a default instance. You can tell whether it is a named instance or not by looking in the Services applet (Control Panel > Administrative Tools). There you should see at least one instance of <code>SQL Server</code>, and it will be followed either by <code>(MSSQLServer)</code> or <code>(InstanceNameYouChose)</code>. Here I have three named instances of SQL Server (the named instances are SQL2005, SQL2008, and SQL2012):</p> <p><img src="https://i.stack.imgur.com/LQFAQ.png" alt="enter image description here"></p> <p>If you have a named instance, then you would connect in Management Studio using:</p> <pre><code>.\InstanceNameYouChose </code></pre> <p>So for example, to connect to my SQL2008 instance, I would say:</p> <pre><code>.\SQL2008 or ServerName\SQL2008 or (local)\SQL2008 or LOCALHOST\SQL2008 or 127.0.0.1\SQL2008 etc. etc. </code></pre> <p>If you have a default instance then you don't need the slash and the subsequent name, it would just be:</p> <pre><code>. or ServerName or (local) or LOCALHOST or 127.0.0.1 etc. etc. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload