Welcome to this introduction to ApexSQL Log. ApexSQL Log is a SQL Server transaction log reader, which not only allows you to view data in your transaction logs in a format you can understand, but also roll back changes, recover data, and determine who made those changes. In this video, I will show you how to view the data in your log for a specified period, find out who performed a certain action on the database, identify all the operations which form part of the same transaction, and roll back any unwanted changes. This script adds some rows into the production.unit measure table, then updates the production.product table, and then deletes the rows it added.
Now let's look at the data in ApexSQL Log. First, you will connect to the database. We will select AdventureWorks. We will only use the online transaction log. We only want to view changes made in the last couple of minutes, so we will select Custom and specify today's date, and then we can type the time in here. ApexSQL Log also offers other filter capabilities, like operations and tables, but for the purpose of this demonstration, we will just focus on date and time.
You can view the results in different ways. Open Results in Grid. This option displays the results in a grid and allows additional filtering, advanced transaction selection, and operation. Export Results to File. This option exports the results to a specified file format. Create, Undo, and Redo Script. The supported file formats are HTML, XML, SQL, CSV, and SQL Bulk files. We will use Open Results in Grid.
As you can see, here we have the inserts. Here, we have the update. And here, we have the deletes. If you click on any of these operations, you can see the operation details, the row history, the undo script, the redo script, and the transaction information, such as when it occurred and who did it.
The grid filter on the left-hand side allows you to filter the grid on the right-hand side. So if you select a date range here, it will be a subset of a date range previously selected. If you want to export a row, you can check it, right-click on it, and export it as an XML, CSV, HTML, SQL Script, or SQL Bulk file.
Now, let's have a look at transactions. First, we will run another script to run a transaction. It begins a transaction, then it performs some tasks which should be done as a unit, and then commits the transaction. If the schema and object name is shown as Unknown, it means the object has been dropped and the object name is no longer available. If you don't want to see dropped operations, you can go to Data Operations and uncheck the Show Operations on Dropped Table checkbox.
We have created a transaction that performed four operations. The nice thing of ApexSQL Log is you can see which operation from part of a transaction by right-clicking on it and selecting the Select Transaction option from the context menu, which will then select all of the operations that occurred within that transaction. And then, you can create an undo or redo script for the entire transaction. These are just a few of the useful features of ApexSQL Log. Please download our free trial to try it out for yourself. Thank you for watching this video.