Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 4th, 2003, 05:03 PM
Registered User
 
Join Date: Jun 2003
Location: , , USA.
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!
Reply With Quote
  #2 (permalink)  
Old June 9th, 2003, 01:00 PM
Authorized User
 
Join Date: Jun 2003
Location: Colombo 04, WP, Sri Lanka.
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)
Reply With Quote
  #3 (permalink)  
Old June 9th, 2003, 07:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #4 (permalink)  
Old July 16th, 2003, 01:47 PM
Authorized User
 
Join Date: Jun 2003
Location: Ft. Lauderdale, Florida, USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:39 AM.


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