use master
go
declare @databaseName varchar(50), @backupFileName varchar(100), @restoreDirectory varchar(100)
— Set the name of the database to restore
set @databaseName = ‘database’
— Set the path to the directory containing the database backup
set @restoreDirectory = ‘pathBackupsLogsfolder’
— Create the backup file name based on the restore directory, the database name and today’s date
set @backupFileName = @restoreDirectory + @databaseName + ‘_’ + replace(convert(varchar, getdate(), 112), ‘-‘, ‘.’) +’1330’+ ‘.trn’
RESTORE LOG database FROM DISK = @backupFileName WITH NORECOVERY