当我启用数据库时,表是否会在SQL Server中自动启用CDC?

发布于 2025-02-10 14:57:23 字数 234 浏览 3 评论 0原文

我创建了一个数据库并在其中创建了一个表。 之后,我使用execss.sp_cdc_enable_db启用了CDC。当我检查时,为CDC启用了数据库,但是该数据库内的表不适合自动启用。

我知道,我们可以一对一地启用CDC作为表格,但我想这样做:当我在任何数据库上启用CDC时,它内部的表将自动启用CDC。

在为数据库启用CDC时,我是否缺少某些内容,还是在存储过程中(上)本身是否应该还有其他参数?

I have created a database and created a table in it.
After that, I enabled CDC using exec sys.sp_cdc_enable_db for the whole database. When I checked, the database was enabled for CDC but the tables inside this database were not enabled for CDC automatically.

I know, we can enable CDC for tables one-by-one but I want to do that: When I enable CDC on any database, the tables inside it will automatically be enabled for CDC.

Am I missing something while enabling CDC for the database or should there be some other parameter in the stored procedure (above) itself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余罪 2025-02-17 14:57:23

启用了数据库以进行更改数据捕获后,
DB_owner固定数据库角色可以为
通过使用存储过程的单个源表
sys.sp_cdc_enable_table。确定源表是否具有
已经启用了用于更改数据捕获的方法,检查
IS_TRACKED_BY_CDC列在SYS.Tables目录视图中。

更改数据捕获 - 启用表

After a database has been enabled for change data capture, members of
the db_owner fixed database role can create a capture instance for
individual source tables by using the stored procedure
sys.sp_cdc_enable_table. To determine whether a source table has
already been enabled for change data capture, examine the
is_tracked_by_cdc column in the sys.tables catalog view.

Change Data Capture - Enable For a Table

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文