template 1 template 2 template 3

Browse by Category

There is no category under MS SQL

Manually restore MS SQL database through Management Studio

icon

Published: 05/14/2010 by admin

Categories: MS SQL

Tags: microsoft ms sql 2005 2008 backup restore

This article was written for MS SQL 2005/2008:

 

1) MS SQL service generally runs with NETWORK SERVICE permissions.  You will need to first move your backup file to a location readable by this user account.  Typical examples are:
C:\
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup

2) If you have not done so already, create a SQL user login account for this database through Management Studio.  Do not attempt to assign a User Mapping role at this point.

3) Through Management Studio, right-click "Databases" -> Restore Database...

4) Under "General":

-If the database has not yet been created under this instance of MS SQL, enter the name under "To database:", otherwise select it from the drop-down list.

-Select "From device" and click the browse button "...".  Click "Add" and select your backup file.  It should now be listed under "Backup location:".  Click OK to close this dialog box.

-Your backup set show now be listed under "Select the backup sets to restore:".  Click the checkbox under "Restore".

Under "Options":

-If the database has already been created under this instance of MS SQL, select "Overwrite the existing database".

-If the SQL backup was created under your instance of MS SQL, you should not need to modify the "Restore As" paths.  Otherwise, verify your servers data paths and modify these fields as necessary.  Typical locations are:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
or
C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data

-Click OK to begin the restore.

5) If this backup was created through your instance of MS SQL, you will likely not need to restore the User Mapping.  Otherwise, locate and right-click the database -> New Query

-Under the query editor, create and execute the following query:

USE database_name;
GO
EXEC sp_change_users_login 'Update_One', 'old_user_name', 'new_user_name';
GO

NOTE: the values for 'old_user_name' and 'new_user_name' may be the same -- this is normal operation.