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

From DevOps Notebook
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
USE [master]
 
USE [master]
  
RESTORE DATABASE [Database.Name]  
+
RESTORE DATABASE [YourDatabase.Name]  
 
FROM  DISK = N'C:\PathToBackupFiles.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