开发者

Cannot rename a column that is "replicated", probably due to 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开发者_如何学C 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜