SQL Server – Undocumented – Function Calls / Day 01

Background

Profiling our database system and noticed a call to sp_MSreset_synctran_bit.

Wanted to review a bit.

sp_MSreset_synctran_bit

Code


 BEGIN TRANSACTION
    -- Unmark synctran bit
    select @tabid = object_id(@qualified_name)
    if not (@tabid is null)
    begin
        IF ISNULL(OBJECTPROPERTY(@tabid, 'TableIsMemoryOptimized'), 0)  1
        Begin
            EXEC %%Object(MultiName = @qualified_name).LockMatchID(ID = @tabid, Exclusive = 1, BindInternal = 0)
            --EXEC %%Object(MultiName = @qualified_name).LockExclusiveMatchID(ID = @tabid)
            if @@error = 0
                EXEC %%Relation(ID = @tabid).SetSyncTranSubscribe(Value = 0)
        End
    end
    COMMIT TRANSACTION
    return(0)

Dissect

  1. EXEC %%Object(MultiName = @qualified_name).LockMatchID(ID = @tabid, Exclusive = 1, BindInternal = 0)
    • A Lock semaphore/mutex
      • passes along the Object ID
  2. EXEC %%Relation(ID = @tabid).SetSyncTranSubscribe(Value = 0)
    • Set Sync Transaction Subscriber
      • Reset value to 0
      • Likely means not synched

Not Familiar

Not familiar with the %% syntax.

Summary

Still undocumented.  Still unfamiliar.

But, like them men, women, and children standing in line this afternoon to get their citizenship the day started out one way.

But, prayerfully and graciously is ending on the other side.

Here is to all those who stood with and among them on this glorious journey.