English 中文(简体)
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 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.

问题回答

暂无回答




相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

SQL server: Can NT accounts be mapped to SQL server accounts

In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签