Forum Discussion
neilhiorns
Oct 25, 2024Copper Contributor
Create and Import Database
We are moving databases from one server using SQL Server 2019 to 2022.
Using the script below and although it works, when coplete the new database is in recovery mode, what am I missing?
CREATE DATABASE DatabaseName;
RESTORE DATABASE DatabaseName FROM DISK = 'D:\Backups\DatabaseName' WITH Replace,
MOVE 'DatabaseName' TO 'D:\data\DatabaseName.mdf',
MOVE 'DatabaseName_log' TO 'E:\log\Logs\DatabaseName_log.ldf'';
2 Replies
- Mike_LemayCopper Contributor
Sometimes I will setup the restore using the GUI in SSMS and save it to a new query window so I can see the actual script syntax. Especially if it's a task I'll be performing routinely.
- olafhelperBronze Contributor
neilhiorns wrote:what am I missing?
The option "RECOVERY" for final recovery, see