"ROLLBACK TRANSACTION" notification - SQL 2000 ?

  • Hi All,

    I'm wondering whether there's any way to get the Server to record that it's doing a "ROLLBACK TRANSACTION" on a SQL transaction or that a transaction has timed out ?

    Anything would do, writing to a log, send an email etc ...

    I've had a look in "Manage SQL Server Messages" in EM but couldn't find anything.

    I can't keep a trace going as I'm not sure when / if the problem will happen again.

    Any ideas ?

    Thanks for reading.

    --****************************

    CREATE TABLE [dbo].[RollTest] (

    [CounterFld] [int] IDENTITY (1, 1) NOT NULL ,

    [RowText] [char] (10) COLLATE Latin1_General_CI_AS NULL

    ) ON [PRIMARY]

    GO

    BEGIN TRANSACTION

    INSERT INTO RollTest (RowText) values ('1')

    INSERT INTO RollTest (RowText) values ('2')

    INSERT INTO RollTest (RowText) values ('3')

    -- I want this rollback logged if possible

    ROLLBACK TRANSACTION

  • Why can't you run a server-side trace? The impact is minimal if you limit events and columns returned and put a filter on.

    You could also put a RaisError() with log after any rollback.

  • Thanks for the reply.

    Ideally I'd like something that would be just write out the Rollbacks, as opposed to having to scan through big files.

    In the meantime I'll set up a local profiler trace with

    SQL:StmtCompleted and

    SQL:BatchCompleted

    filtered for "ROLLBACK TRANSACTION" like you suggest.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply