0

Is it possible for me to restore a SQL Server 2019 database up to a particular datetime? The database backup is full backup.

The database is full recovery mode, and only one transaction log backup after the full backup. Thanks.

hosir
  • 101
  • 1

1 Answers1

0

You can do it through T-SQL this way:

RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK' 
WITH NORECOVERY
GO 
RESTORE LOG AdventureWorks FROM DISK = 'C:\AdventureWorks.TRN' 
WITH RECOVERY, 
STOPAT = 'Mar 23, 2009 05:31:00 PM' 
GO

But don't forget you can use the GUI from SSMS. The graphical solution is easier to understand especially if you are 4 people around the same monitor and the manager is behind you with a stick in his hand:

  1. Right click on the database > Tasks > Restore > Database

enter image description here

  1. General > Timeline and setup the time for database restoration

enter image description here

  1. Check in “Specific date and time” to set up the time for database restoration, press “OK” to save changes, and press “OK” button in the previous window

enter image description here

Francesco Mantovani
  • 1,695
  • 14
  • 28