You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. step:: Enable the SQL Server agent and check database permissions
89
+
90
+
To enable the CDC option at the table level:
91
+
92
+
a. You must have the server level ``sysadmin`` role.
93
+
#. You must have the database level ``db_owner`` role.
94
+
#. The `SQL Server agent <https://learn.microsoft.com/en-us/sql/ssms/agent/sql-server-agent?view=sql-server-ver16>`__
95
+
must be running.
96
+
#. The service account used to connect to SQL Server
97
+
must have Select permission against all required tables.
98
+
99
+
.. step:: Configure CDC at the table level
100
+
101
+
To enable CDC at the table level
102
+
use the ``sys.sp_cdc_enable_table`` stored procedure.
103
+
104
+
You can check the SQL Server CDC settings by examining the ``is_tracked_by_cdc``
105
+
column in the `sys.tables catalog view <https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-tables-transact-sql?view=sql-server-ver16>`__.
106
+
A value of ``1`` for ``is_tracked_by_cdc`` indicates the table
107
+
is enabled for change data capture.
108
+
109
+
The code block below is a sample of the
110
+
automatically generated code.You can run the code manually
111
+
to enable table CDC:
112
+
113
+
.. code-block:: sql
114
+
:copyable: true
115
+
116
+
USE MyDB
117
+
GO
118
+
EXEC sys.sp_cdc_enable_table
119
+
@source_schema = N'dbo',
120
+
@source_name = N'MyTable',
121
+
@role_name = N'MyRole',
122
+
@filegroup_name = N'MyDB_CT',
123
+
@supports_net_changes = 1
124
+
GO
125
+
126
+
Learn More
127
+
----------
128
+
129
+
Relational Migrator relies on the open-source Debezium connector to
130
+
capture row-level changes. For more details, see
131
+
`Debezium SQL Server <https://debezium.io/documentation/reference/stable/connectors/sqlserver.html#_enabling_cdc_on_a_sql_server_table>`__.
0 commit comments