1USE AdventureWorks
2GO
3BEGIN TRANSACTION ListPriceUpdate
4 WITH MARK 'UPDATE Product list prices';
5GO
6
7UPDATE Production.Product
8 SET ListPrice = ListPrice * 1.10
9 WHERE ProductNumber LIKE 'BK-%';
10GO
11
12COMMIT TRANSACTION ListPriceUpdate;
13GO
14
15-- Time passes. Regular database
16-- and log backups are taken.
17-- An error occurs in the database.
18USE master
19GO
20
21RESTORE DATABASE AdventureWorks
22FROM AdventureWorksBackups
23WITH FILE = 3, NORECOVERY;
24GO
25
26RESTORE LOG AdventureWorks
27 FROM AdventureWorksBackups
28 WITH FILE = 4,
29 RECOVERY,
30 STOPATMARK = 'ListPriceUpdate';
31