sql-servercdc

I do not find the cdc.fn_cdc_get_net_changes_*


I am developing SQL Server business logic using CDC. The CDC works fine, I see the changes in cdc tables but I cannot find function cdc.fn_cdc_get_net_changes*. But other functions exist: cdc.fn_cdc_get_all_changes* etc What is the reason and how to find it?


Solution

  • These functions only get created if you specify @supports_net_changes = 1 when you enable the table for cdc, see sys.sp_cdc_enable_table. The capture instance specified is concatenated to the function name and if you do not specify a capture instance then the default will be <schema_name>_<table_name>.

    If you have support net changes turned on and use the default capture instance, then you should be looking for TVF's named similar:

    cdc.fn_cdc_get_net_changes_dbo_TableName