How to modify "max text repl size" for Azure SQL

dineshkumar rajendran 1 Reputation point
2022-05-18T06:48:29.83+00:00

Hi All,

I have enabled CDC in one my Azure SQL instance, and there is an Insert/Update failure happening on capturing particular table with the error message below

Sql error number: 7139. Error Message: Length of LOB data (97318) to be replicated exceeds configured maximum 65536

I further checked and found that the sys.configuration parameter "max text repl size" has to be set to -1 to avoid this issue. But I am unable to perform this update in Azure SQL as "sp_configure" is not supported yet.

Please let me know how this can be updated in Azure SQL ? or do we have any alternate to avoid this issue ?

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 32,886 Reputation points MVP
    2022-05-18T12:53:11.29+00:00

    To my knowledge, at this time, you cannot change that setting on Azure SQL Database.

    As a workaround, please try to exclude the columns exceeding limit from capture instance using captured_column_list in sp_cdc_enable_table.

    EXECUTE sys.sp_cdc_enable_table      
    @source_schema = N'dbo'    , 
    @source_name = N'Orders'    , 
    @role_name = N'cdc_Admin'    , 
    @captured_column_list = N'OrderID,CustomerAccount,Product,SalesPerson'
    

    You can include only the columns that don't exceed the limit.

    You can also stop pushing that table to the mirror.

    EXEC sys.sp_cdc_disable_table  
    @source_schema = N'dbo',  
    @source_name   = N'MyTable',  
    @capture_instance = N'dbo_MyTable'  
    GO 
    

    If you cannot exclude the column, please consider using Temporal Tables or Change Tracking instead.