Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2003, 05:03 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transaction Log

Hi everyone,
I have to extract from Transaction Log information about the insert/update/delete operations. I am now trying the Log Explorer from Lumigent - which seems to solve my issue in a very cool way - only I'm not sure whether the company is willing to buy the product (one licence for each server on the cluster). So I would probably develop a parse from scratch, to interpret something like Record Data from the result of something like DBCC log(databasename, type=4). I don't know where to find a description of the binary format.
Any idea will be very helpful and greatly appreciatedl!
 
Old June 9th, 2003, 01:00 PM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Preethi Send a message via Yahoo to Preethi
Default

Sorry to give this answer:

Some time back I checked this Q with Kalen Delaney the author of Iside SQL Server 2000. (One of the Hardcore SQL Server Books) This is what his response is:


Thanks for writing.


Microsoft will not release info about the internal structure of the transaction log. Everything they were willing to tell me is in the book. Lumigent figured it out on their own by analysis of the files at the lowest level. It took many people working for many many months to figure it out, and that is why their product is so expensive. There is no way I could do the same thing on my own.

-Kalen Delaney



As far as I know, there is know way of reading transaction log unless Microsoft discloses the information (I am wondering why they keep it as such secret) or you Find it yourself.


Preethi
(G.R.Preethiviraj Kulasingham)
 
Old June 9th, 2003, 07:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Preethi
Some time back I checked this Q with Kalen Delaney the author of Iside SQL Server 2000. (One of the Hardcore SQL Server Books) This is what his response is:
Her response. Kalen Delaney is a woman.
http://www.insidesqlserver.com/author.html

regards
David Cameron
 
Old July 16th, 2003, 01:47 PM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After trial and error I have found how you can create a trigger on a table that will show what is happening in your tables. This shows that you can log the original value before change, the new value after change, who changed it and when. This sample is based on the authors table in the Pubs db.




/* This is the sample Log table*/
CREATE TABLE [LogTable] (
    [LogID] [int] IDENTITY (1000, 1) NOT NULL ,
    [FromLine] [char] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [RECID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    CONSTRAINT [PK_LogTable] PRIMARY KEY CLUSTERED
    (
        [LogID]
    ) ON [PRIMARY]
) ON [PRIMARY]
GO
/* This is the sample TRIGGER TO be added to the authors TABLE IN the Pubs db*/
CREATE TRIGGER [LogTrig] ON [dbo].[authors]
FOR INSERT, UPDATE, DELETE
AS
DECLARE @Myvar char(50), @Myvar2 Char(50)
SET @myvar = (SELECT au_id FROM deleted)
SET @Myvar2 = (Select State FROM authors WHERE au_id = @myvar)
INSERT INTO LogTable
(fromLine,RECID)
SELECT 'Changed State FROM ' + isnull(state,'<NULL>') + ' TO ' + isnull(rtrim(@MyVar2),'<NULL>') + ' BY ' + SYSTEM_USER + ' on ' + convert(char,getdate()),au_id
FROM deleted


Thanks,
Jesse





Similar Threads
Thread Thread Starter Forum Replies Last Post
Transaction log carumuga SQL Server 2005 0 August 7th, 2008 05:38 AM
Truncating Transaction Log ninel SQL Server 2000 1 November 18th, 2006 01:26 PM
use of transaction log madhukp SQL Server 2000 1 July 16th, 2004 06:20 PM
transaction log full Jane SQL Server 2000 1 January 28th, 2004 09:59 AM
log and transaction issue ak SQL Server 2000 0 September 29th, 2003 06:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.