Introduction
In this article I want to show how you can view the SQL Server transaction
log for version 6.5 and for version 7.0.
It’s not necessary to view the SQL Server transaction log, but if you
are a DBA, it may be useful to resolve some problems. It may be useful
for understanding the internal SQL Server architecture too.
SQL Server 6.5
Every database contains the syslogs system table in SQL Server 6.5.
This table contains the transaction log, and is used by SQL Server
for recovery and roll forward. You can not modify syslogs system
table manually.
This is from SQL Server Books Online (fields of syslogs table):
|
So, to view the transaction log you can use the following select statement:
|
There are some op values:
|
SQL Server 7.0
There is no syslogs system table in SQL Server 7.0. The database
log is now an operating system file. So this SQL statement:
|
will return error:
|
You can use the following undocumented command in this case:
|
PARAMETERS:
Dbid or dbname - Enter either the dbid or the name of the database in question. type - is the type of output: 0 - minimum information (operation, context, transaction id) 1 - more information (plus flags, tags, row length) 2 - very detailed information (plus object name, index name, page id, slot id) 3 - full information about each operation 4 - full information about each operation plus hexadecimal dump of the current transaction log's row. by default type = 0
To view the transaction log for the master database, you can run the
following command:
|
Literature
1. SQL Server Books Online.
2. “How can I view the SQL Server log?”
http://www.ntfaq.com/Faq.cfm?FaqID=686
3. “Update Methods Used in MS SQL 6.5”
https://www.databasejournal.com/features/mssql/article.php/1442311
4. “Update Methods Used in MS SQL 7.0”
https://www.databasejournal.com/features/mssql/article.php/1443671