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:
- start SQL Server Management Studio Express ( I am using SQL Server 2005 express);
- create a new empty database “aNewDb”;
- right click on Databases in Object Explorer;
- select “Restore Database”, and then Restore Database window pops up;
- select the new-created database “aNewDb” to “To database:” box;
- check “From device:” and go find the bak file, and then one record should show up in backup sets;
- check the checkBox in the sets list for restore;
- click “Options” on the left, and MUST check “Overwrite the existing database”;
- 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.
- click “OK”, and done!
You would get the new database with the backup data.