无法重命名“复制”的列,可能是由于 CDC
我想运行以下重命名,
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你做错了顺序。您必须关闭表上的 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.