Thinking outside the box

Patron Saint of Lost Yaks
posts - 203, comments - 734, trackbacks - 4

My Links

Advertisement

News

Archives

Post Categories

Reading the transaction log

SELECT        *
FROM          ::fn_dblog(DEFAULT, DEFAULT) AS l
INNER JOIN    sysobjects AS so ON so.name = l.[transaction name]

SELECT        so.name AS ObjectName,
              so.type AS ObjectType,
              MAX(CAST(l.[Begin Time] AS DATETIME)) AS LogTime
FROM          ::fn_dblog(DEFAULT, DEFAULT) l
inner join    sysobjects so on so.name = l.[transaction name]
--where              so.type = 'u'
GROUP BY      so.name,
              so.type
ORDER BY      so.name,
              so.type

Print | posted on Thursday, November 13, 2008 9:49 AM | Filed Under [ SQL Server 2008 Algorithms SQL Server 2005 SQL Server 2000 ]

Feedback

Gravatar

# re: Reading the transaction log

That's a really useful script for looking at the transaction log.

I haven't needed to look at the transaction log ever since my last project that used replication. Can you think of any other situations where this information will help solve problems. It would make a good post.

Cheers
11/13/2008 3:15 PM | Michael Swart
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET