Code Simplified – Viral Sarvaiya

Code Simplified – Viral Sarvaiya, Web Developer Friends, dot net Developer, Sql Server Developer

Restore SQL server database with structure and data from bak file

Posted by Viral Sarvaiya on July 9, 2010

A bak file is generated for backup a database structure and data. If you want to restore a bak file from SQL Server database, you can do it with SQL Server management studio express as followed:

  1. start SQL Server Management Studio Express ( I am using SQL Server 2005 express);
  2. create a new empty database “aNewDb”;
  3. right click on Databases in Object Explorer;
  4. select  “Restore Database”, and then Restore Database window pops up;
  5. select the new-created database “aNewDb” to “To database:” box;
  6. check “From device:” and go find the bak file, and then one record should show up in backup sets;
  7. check the checkBox in the sets list for restore;
  8. click “Options” on the left, and MUST check “Overwrite the existing database”;
  9. MUST make sure that the files for “Restore As” are of the “aNewDb”, but sysft_aNewDb’s path could not be same as the path of the mdf and ldf files.
  10. click “OK”, and done!

You would get the new database with the backup data.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: