SQL Flow Field Guide

CHANGETABLE

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

change tracking read

What changes

Input
change tracking data for a table since a version
Output or change
rowset of changed keys with SYS_CHANGE_* columns
Return type
table

Syntax at a glance

CHANGETABLE ( { CHANGES <table_name> , <last_sync_version> | VERSION <table_name> , <primary_key_values> } , [ FORCESEEK ] ) [AS] <table_alias> [ ( <column_alias> [ ,...n ] )

Work example

A sync process needs row changes since a saved change-tracking version.

Use a disposable database with change tracking enabled. Save the starting version and test retention expiry before building a sync cursor.

Check your work CHANGETABLE. Every changed key is returned once for the requested version and expired versions are detected.

Open Microsoft Learn for full syntax, permissions, and details for your version.