Sources
Microsoft SQL Server
Required settings
- Host name
- Port (default is
1433
) - Service account
- Database name
- CDC enabled for database and tables to replicate
Creating a service account
Creating a service account
Enabling CDC
Enabling CDC
In order to enable CDC for SQL Server, you will enable it at the database and table level.
- Enable CDC for your database
- Enable CDC for your tables
Troubleshooting
Unique index override
Unique index override
By default, sys.sp_cdc_enable_table
will use the primary keys of the table as the unique identifiers.
If you are running into issues with this, you can optionally set @index_name
to an unique index of your choice.
For example, if you had a table that looked like this
If you don’t want to use id
, you can do something like this: