Skip to content

Commit d333344

Browse files
author
AbhishekMallick01
committed
minor changes
1 parent 2143e16 commit d333344

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/backup/restore-sql-database-azure-vm.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ To restore the database files to the *original path on the source server*, remov
198198
**Example**
199199

200200
```
201-
USE [master]
202-
RESTORE DATABASE [<DBName>] FROM  DISK = N'<.bak file path>'
201+
USE [master]
202+
RESTORE DATABASE [<DBName>] FROM  DISK = N'<.bak file path>'
203203
``` 
204204

205205
>[!Note]
@@ -208,16 +208,16 @@ To restore the database files to the *original path on the source server*, remov
208208
To relocate the database files from the target restore server, you can frame a TSQL command using the `MOVE` clauses.
209209

210210
```
211-
USE [master]
212-
RESTORE DATABASE [<DBName>] FROM  DISK = N'<.bak file path>'  MOVE N'<LogicalName1>' TO N'<TargetFilePath1OnDisk>',  MOVE N'<LogicalName2>' TO N'<TargetFilePath2OnDisk>' GO
211+
USE [master]
212+
RESTORE DATABASE [<DBName>] FROM  DISK = N'<.bak file path>'  MOVE N'<LogicalName1>' TO N'<TargetFilePath1OnDisk>',  MOVE N'<LogicalName2>' TO N'<TargetFilePath2OnDisk>' GO
213213
```
214214

215215
**Example**
216216
217217
``` 
218-
USE [master]
219-
RESTORE DATABASE [test] FROM  DISK = N'J:\dbBackupFiles\test.bak' WITH  FILE = 1,  MOVE N'test' TO N'F:\data\test.mdf',  MOVE N'test_log' TO N'G:\log\test_log.ldf',  NOUNLOAD,  STATS = 5
220-
GO
218+
USE [master]
219+
RESTORE DATABASE [test] FROM  DISK = N'J:\dbBackupFiles\test.bak' WITH  FILE = 1,  MOVE N'test' TO N'F:\data\test.mdf',  MOVE N'test_log' TO N'G:\log\test_log.ldf',  NOUNLOAD,  STATS = 5
220+
GO
221221
```
222222

223223
If there are more than two files for the database, you can add additional move clauses to the restore query. You can also use SSMS for database recovery using `.bak` files. Learn more on [restoring an SQL database backup using SSMS]( /sql/relational-databases/backup-restore/restore-a-database-backup-using-ssms?view=sql-server-ver16).

0 commit comments

Comments
 (0)