Difference between revisions of "MSSQL Database stuck in restore state"

From DevOps Notebook
(Created page with "<syntaxhighlight lang="sql"> USE [master] RESTORE DATABASE [SportifierDB_Restore] FROM DISK = N'D:\BackupFromPRD\AutoRestore\AutoRestoreSpotifierDBFresh.bak' WITH RECOVERY...")
 
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
USE [master]
 
USE [master]
  
RESTORE DATABASE [SportifierDB_Restore]  
+
RESTORE DATABASE [YourDatabase.Name]  
FROM  DISK = N'D:\BackupFromPRD\AutoRestore\AutoRestoreSpotifierDBFresh.bak' WITH RECOVERY
+
FROM  DISK = N'C:\PathToBackupFiles.bak' WITH RECOVERY
 +
</syntaxhighlight>
 +
 
 +
With in-memory database:
 +
<syntaxhighlight lang="sql">
 +
USE [master]
 +
 
 +
RESTORE DATABASE [YourDatabase.Name]
 +
FROM  DISK = N'C:\PathToBackupFiles.bak' WITH RECOVERY,
 +
MOVE N'XTP' TO N'C:\MSSQL\Data\XTP'
 +
GO
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 09:13, 6 September 2022

USE [master]

RESTORE DATABASE [YourDatabase.Name] 
FROM  DISK = N'C:\PathToBackupFiles.bak' WITH RECOVERY

With in-memory database:

USE [master]

RESTORE DATABASE [YourDatabase.Name] 
FROM  DISK = N'C:\PathToBackupFiles.bak' WITH RECOVERY,
MOVE N'XTP' TO N'C:\MSSQL\Data\XTP'
GO