无法重命名“复制”的列,可能是由于 CDC

发布于 2024-08-22 12:52:47 字数 536 浏览 2 评论 0原文

我想运行以下重命名,

EXECUTE sp_rename N'dbo.Semesters.IsPublic', N'Tmp_ShowNCs', 'COLUMN' 

但出现错误:

Msg 4928, Level 16, State 1, Procedure sp_rename, Line 547
Cannot alter column 'IsPublic' because it is 'REPLICATED'.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.

我已为此表启用更改数据捕获 (CDC)。也许这就是本专栏被“复制”的原因。 SSMS 显示已复制 = 是。

所以我想知道这是正常现象还是错误。我想保留 CDC,但重命名此列。除了删除现有 CDC 信息并重新启用 CDC 之外,我还有其他选择吗?

I want to run the following rename

EXECUTE sp_rename N'dbo.Semesters.IsPublic', N'Tmp_ShowNCs', 'COLUMN' 

I get the error

Msg 4928, Level 16, State 1, Procedure sp_rename, Line 547
Cannot alter column 'IsPublic' because it is 'REPLICATED'.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command.  The results, if any, should be discarded.

I have enabled change data capture (CDC) for this table. Probably thats why this column is "replicated". SSMS shows replicated = yes.

So I want to know if this is normal or a bug. I want to keep CDC on but rename this column. Do I have options other than deleting existing CDC information and re-enabling CDC?

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

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

发布评论

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

评论(1

野却迷人 2024-08-29 12:52:48

你做错了顺序。您必须关闭表上的 CDC(数据库上的 CDC 已打开),然后更改列,然后打开表上的 CDC。
要解决您的问题,您必须在数据库上打开 CDC,然后在表上打开 CDC,在表上关闭 CDC,重命名列,在表上打开 CDC。

you did in wrong order. You have to turn off CDC on table (CDC on DB is turned on), then change column, then turn On CDC on table.
To undo your problem you have to turn on CDC on DB, then on table, turn off CDC on table, rename column, turn on CDC on table.

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