[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

How to restore a database?

I'm new to SQL Server but have a lot of experience with MySQL and PHPMyAdmin.

I have a backup of an MS SQL database (a BAK file).
On my PC, I have MS SQL Server 2008 Express and Microsoft SQL Server Management Studio.
I thought I would be able to go in to the Studio and find something like "File > Restore" but no such thing.

I searched the Studio help and all I found was stuff like "you can copy a database using restore ... " but nothing that actually tells me how!

The database itself already exists on my PC (it was created when I installed the Ektron Content Management System). Now I'm just trying to overwrite it with the database that is backed up, because that one actually contains some relevant data.

I think I just need to enter this command "somewhere" but where is the "somewhere"?( In phpMyAdmin with a MySQL database, I would just open a "SQL" tab and enter the command. I find no such thing in SQL Management Studio.)

RESTORE DATABASE mydatabasename FROM mydatabasebackupfile WITH NORECOVERY;

Seems like it should be simple but obviously I am missing something!

2 Solutions
Guy Hengel [angelIII / a3]Billing EngineerCommented:
check out in the databases folder's context menu, you can issue a "restore" from there, or use SQL window and issue a restore using T-SQL.
basic minimal syntax:
RESTORE DATABASE dbname FROM DISK='c:\backup_of_database.bak'

more info:
here you are how to restore from SQL Management Studio


this is what you need
alicia1234Author Commented:
Both are correctt and came in within a minute of each other. Thanks.


Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now