views:

139

answers:

1

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?

+1  A: 

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.

showstoppa