Need to edge out the competition for your dream job? Train for certifications today.
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.
, t1.[Transaction ID],
t1.[RowLog Contents 0],
(SELECT COUNT(cvalue) - 1 from dbo.fn_split(T1.AllocUnitName,'.'))
WHEN 1 THEN
- CHARINDEX('.', T1.AllocUnitname))
WHEN 2 THEN
- CHARINDEX('.', T1.AllocUnitname)),
-1 + CHARINDEX('.', RIGHT(T1.AllocUnitname,
- CHARINDEX('.', T1.AllocUnitname))))
END) AS [TableName]
FROM master.dbo.fn_dblog(null, null) AS T1
INNER JOIN master.dbo.fn_dblog(null, null) as tBegin
ON tBegin.Operation = 'LOP_BEGIN_XACT'
AND t1.[Transaction Id] = tBegin.[Transaction Id]
INNER JOIN master.dbo.fn_dblog(null, null) as tEnd
ON tEnd.Operation = 'LOP_COMMIT_XACT'
AND tEnd.[Transaction Id] = tBegin.[Transaction Id]
WHERE t1.[Operation] IN ('LOP_DELETE_ROWS', 'LOP_INSERT_ROWS', 'LOP_MODIFY_COLUMNS', 'LOP_MODIFY_ROW')
AND t1.AllocUnitName NOT LIKE 'sys%'
AND t1.AllocUnitName <> 'Unknown Alloc Unit'
AND (CONVERT(datetime, tBegin.[Begin Time]) BETWEEN @STIME AND @ETIME)
AND (CONVERT(datetime, tEnd.[End Time]) BETWEEN @STIME AND @ETIME)
AND t1.AllocUnitName NOT LIKE '%MSmerge_%'
ORDER BY [End Time]
Open in new window
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment