-- 1
Use master
Backup database logtest
To disk = 'd: \ Program Files \ Microsoft SQL Server \ mssql10.mssqlserver \ MSSQL \ backup \ logtest. Bak'
With format
-- 2
Use logtest
Create Table table_1 (ID int, test varchar (max ))
Insert table_1 (ID, test) values (1, '20140901 ');
Insert table_1 (ID, test) values (2, '201312 ');
Insert table_1 (ID, test) values (3, '201312 ');
Use master
-- 2.1
Waitfor delay '00: 00: 05'
Go
Use logtest
Truncate table table_1
Select getdate ()
Use master
-- 3
Use master
Backup log logtest
To disk = 'd: \ Program Files \ Microsoft SQL Server \ mssql10.mssqlserver \ MSSQL \ backup \ logtest_log.bak'
With format
-- 4
-- Declare @ DT datetime
-- Select @ dt = dateadd (MS,-1800, getdate ())
-- Select @ dt
Restore database logtest
From disk = 'd: \ Program Files \ Microsoft SQL Server \ mssql10.mssqlserver \ MSSQL \ backup \ logtest. Bak'
With replace
Restore log logtest
From disk = 'd: \ Program Files \ Microsoft SQL Server \ mssql10.mssqlserver \ MSSQL \ backup \ logtest_log.bak'
With stopat = '2017-10-26 12:38:57. 123'
Go