June 7, 2024 at 12:00 am
Comments posted to this topic are about the item Multi-Database Marked Transactions
June 7, 2024 at 7:57 am
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy