Introduction
Here, I will explain how to restore an SQL Server database from Command Prompt using sqlcmd utility. We will use RESTORE DATABASE command to restore the database from a backup (.bak) taken using BACKUP DATABASE command. Click here for Backup Database from Command Prompt.
Step 1: Open Command Prompt and type sqlcmd -S localhost\SQLServer2014 -U sa , then press enter. Here localhost\SQLServer2014 is server name\instance name and sa is the username.
Image may be NSFW.
Clik here to view.
Note : To restore database using Windows Authentication, type sqlcmd -S localhost\SQLServer2014 -E and press enter and skip the Step 2
Step 2: Type your password and press enter
Image may be NSFW.
Clik here to view.
Step 3: Type RESTORE DATABASE Galaxy FROM DISK=’D:\Data\Galaxy.bak’ and press enter. Here we are restoring a full database from a backup.
Image may be NSFW.
Clik here to view.
Step 4: Type GO and press enter
Image may be NSFW.
Clik here to view.For more information and examples about RESTORE DATABASE command please visit http://msdn.microsoft.com/en-us/library/ms186858.aspx
Filed under: SQL Image may be NSFW.
Clik here to view.
