Multi-Database Marked Transactions

  • Comments posted to this topic are about the item Multi-Database Marked Transactions

  • From BOL: "If a marked transaction spans multiple databases on the same database server or on different servers, the marks must be recorded in the logs of all the affected databases." that means that YOU should set marks by BEGIN TRANSACTION @name WITH MARK.

    Here the sample:

    CREATE PROCEDURE sp_SetMark

    @name nvarchar (128)

    AS

    BEGIN TRANSACTION @name WITH MARK

    UPDATE coyote.dbo.Marks SET one = 1

    COMMIT TRANSACTION;

    GO

    CREATE PROCEDURE sp_MarkAll

    @name nvarchar (128)

    AS

    BEGIN TRANSACTION

    EXEC instance0.coyote.dbo.sp_SetMark @name

    EXEC instance1.coyote.dbo.sp_SetMark @name

    EXEC instance2.coyote.dbo.sp_SetMark @name

    COMMIT TRANSACTION;

    GO

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

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