Restore a full backup first, but be sure to select with Nonerecovery in the full backup (option 2nd in Enterprise Manager)
The SQL statement is:
Restore Database MyData from disk = ' C:\temp\movedb.bak ' WITH NORECOVERY
The database then becomes the recovery mode, so you can restore the trn file by adding it in one piece.
Statement is:
Restore log Mydata from disk = "D:\Program Files\Microsoft SQL Server\mssql\backup\data\data_tlog_200407290022.trn" WI TH norecovery
When you get back to the data you want, you can turn the database into a normal mode.
The statement is:
Restore log Mydata from disk = "D:\Program Files\Microsoft SQL Server\mssql\backup\data\data_tlog_200407290022.trn" WI th recovery
This will allow you to restore the data to a point in time on your spare machine.
/* Use the cursor example below */declare @pathname varchar declare vendor_cursor cursor for SELECT ' D:\XXXX\WWWW\ ' +ttttt from Test OPEN V Endor_cursorfetch NEXT from Vendor_cursor to @pathnameWHILE @ @FETCH_STATUS = 0 BEGIN restore log Mydata from disk = @pathname WITH Norecovery FETCH NEXT from Vendor_cursor to @pathname END CLOSE vendor_cursor
Original address: http://www.jianfangkk.com/sqlserver/201601/275
How to restore a SQL Server transaction log by trn a log file restores a backup