Lesson 3 of 4 Change Detection and Event-Driven Integration

Change Event Streaming

This lesson explains how change event streaming pushes row changes to Event Hubs, how to configure it and its limits.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe what change event streaming sends and where.
  • Identify the configuration steps and procedures.
  • Explain the limitations and operational risks of CES.

What CES does

CES, currently in preview in SQL Server 2025, Azure SQL Database, Azure SQL Managed Instance and SQL database in Fabric, captures INSERT, UPDATE and DELETE changes on selected tables and sends each as a CloudEvent, serialized as JSON or Avro, to Azure Event Hubs or Fabric Eventstream. Events include the operation, the current schema and the old and new values. Unlike Change Tracking and CDC, consumers do not poll the database: many independent consumers, such as microservices, analytics, search indexers or an embedding pipeline, read the same stream from Event Hubs, and the database is decoupled from them.

The following diagram shows change events fanned out to consumers.

Change event streaming. The database captures INSERT, UPDATE and DELETE changes on selected tables and sends each as a CloudEvent, in JSON or Avro, to Azure Event Hubs or Fabric Eventstream, with the operation, the schema and the old and new values. Many independent consumers, such as microservices, analytics, search indexers and an embedding pipeline, read the same stream, so none of them polls the database.
Consumers read the stream instead of polling the database.

Configuring CES

Configuration uses system stored procedures, as the following steps show.

  1. Prepare Event Hubs

    Create an Event Hubs namespace and event hub, and grant the database's managed identity the Azure Event Hubs Data Sender role on that event hub (or use a Send shared access policy).

  2. Create credentials

    Create a database master key and a database scoped credential with IDENTITY = 'Managed Identity'.

  3. Enable streaming

    Run EXEC sys.sp_enable_event_stream in the database (SQL Server 2025 also needs PREVIEW_FEATURES).

  4. Create a stream group

    Run sys.sp_create_event_stream_group with the destination type, location (namespace host, port 9093 and event hub), credential, maximum message size and partition key scheme.

  5. Add tables

    Run sys.sp_add_object_to_event_stream_group for each table to stream.

EXEC sys.sp_enable_event_stream;
EXEC sys.sp_create_event_stream_group
     @stream_group_name      = N'CatalogChanges',
     @destination_type       = N'AzureEventHubs',
     @destination_location   = N'contoso-events.servicebus.windows.net:9093/catalog',
     @destination_credential = EventHubCredential,
     @max_message_size_kb    = 256,
     @partition_key_scheme   = N'None';
EXEC sys.sp_add_object_to_event_stream_group N'CatalogChanges', N'Catalog.Product';
Put in order

Configuring change event streaming

Exam skills 2.4.7

Put the steps for configuring change event streaming in order.

Log in to try this activity Interactive activities are free with an account.

Limits and operations

CES requires the full recovery model, streams only DML (not DDL), does not send rows that existed before it was enabled, and cannot stream tables with clustered columnstore indexes, memory-optimized tables, graph, external, temporal history or ledger history tables, or Always Encrypted. Columns of types such as json, vector and xml are skipped, Dynamic Data Masking and RLS do not apply to streamed data, and a table belongs to one stream group. It cannot be combined with CDC or transactional replication. Because delivery is guaranteed, the transaction log cannot truncate while events are undelivered, so sys.dm_change_feed_errors and log size must be monitored. The AMQP protocol for CES was deprecated in August 2026 in favour of the Kafka protocol on port 9093. The destination type depends on the platform: Azure SQL Database and SQL database in Fabric accept only AzureEventHubs, as in the example above, while SQL Server 2025 and Azure SQL Managed Instance use AzureEventHubsApacheKafka with the same namespace.servicebus.windows.net:9093/eventhub location format.

Sort into groups

Can CES stream it?

Exam skills 2.4.7

Decide whether change event streaming supports each case.

Log in to try this activity Interactive activities are free with an account.
Worked example

Fan-out of order changes

Five microservices must react within seconds to new and changed orders in an Azure SQL database. Today each service polls the Orders table every few seconds, which adds load and duplicates logic. The team accepts a preview feature. What should the developer implement?

Configure change event streaming for the Orders table to an Azure Event Hubs event hub with the database's managed identity, and have each microservice consume the stream with its own consumer group. The database publishes each change once and the services read independently without polling. Change Tracking or CDC would still require every service to poll the database, and a trigger calling five services would slow every order transaction.

Check yourself

Why must the transaction log be monitored when CES is enabled?

Show answer

Delivery is guaranteed, so the log cannot truncate while events are undelivered and can grow until writes fail.

Exam Tips

Remember for the exam

  • Near real-time push of changes to many consumers: CES to Event Hubs or Fabric Eventstream.
  • CES is in preview; events are CloudEvents with old and new values.
  • Setup: sp_enable_event_stream, sp_create_event_stream_group, sp_add_object_to_event_stream_group.
  • Undelivered events prevent log truncation; monitor errors and log size.