sys.sp_change_feed_enable_db (Transact-SQL)

Applies to: SQL Server 2022 (16.x) Azure SQL Database Azure Synapse Analytics Warehouse in Microsoft Fabric SQL database in Microsoft Fabric

Enables current database for Azure Synapse Link for SQL, Microsoft Fabric mirrored databases, and SQL database in Microsoft Fabric.

Note

This system stored procedure is used internally and isn't recommended for direct administrative use. Use Synapse Studio or the Fabric portal instead. Using this procedure could introduce inconsistency.

Syntax

Transact-SQL syntax conventions

EXECUTE sys.sp_change_feed_enable_db
    [ [ @maxtrans ] ]
    [ , [ @pollinterval ]  ]
    [ , [ @destination_type ] ]
GO

Arguments

@maxtrans

Data type is int. Indicates the maximum number of transactions to process in each scan cycle.

  • For Azure Synapse Link, the default value if not specified is 10000. If specified, the value must be a positive integer.
  • For Fabric mirroring, this value is dynamically determined and automatically set.

@pollinterval

Data type is int. Describes the frequency, or polling interval, that the log is scanned for any new changes in seconds.

  • For Azure Synapse Link, the default interval if not specified is 5 seconds. The value must be 5 or larger.
  • For Fabric mirroring, this value is dynamically determined and automatically set.

@destination_type

Applies to: Fabric database mirroring only. For Synapse Link, do not specify.

Data type is int. Default is 0, for Azure Synapse Link. 2 = Fabric database mirroring.

Permissions

A user with CONTROL database permissions, db_owner database role membership, or sysadmin server role membership can execute this procedure.

Examples

The following sample enables the change feed.

EXECUTE sys.sp_change_feed_enable_db;

Verify the database is enabled.

SELECT
    [name]
  , is_data_lake_replication_enabled
FROM sys.databases;