SQL SERVER – FIX – Error – Msg 4928, Level 16, State 1. Cannot Alter Column Because it is ‘Enabled for Replication or Change Data Capture’

SQL SERVER - FIX - Error - Msg 4928, Level 16, State 1. Cannot Alter Column Because it is 'Enabled for Replication or Change Data Capture' crosserror-800x800 One of my Facebook followers sent me an interesting situation, where he faced error related replication or change data capture.

Hi Pinal,
We have a database in our QA environment which is restored from Production (we have replication set up in Production). In QA environment, we don’t have any replication or Change Data Capture (CDC). When we are trying to rename one of the fields in the table in the Lab and got the following error:

--Rename column 
EXEC sp_rename 'dbo.Foo.Bar', 'Bar1', 'COLUMN';

Msg 4928, Level 16, State 1, Procedure sp_rename, Line 611
Cannot alter column ‘Bar’ because it is ‘enabled for Replication or Change Data Capture’.

I have verified the following:

  • None of the tables have is_tracked_by_cdc = 1.
  • None of the tables or columns have is_replicated = 1
  • Replication was already disabled by using sp_removedbreplication.

Any ideas?
Thanks in advance.
John S.

This was not a pretty situation because the error message is not in line with the data points which they have already verified. I strongly felt that somewhere they have metadata incorrect.

Based on my search on the internet, I found that below has helped few of the others.

execute sp_replicationdboption 'DBName','Publish','False',1

But it didn’t work. So, I thought of playing with CDC by enabling and disabling again because this was a restored copy of the production database.


I have provided below script to enable and disable CDC one more time on the table.

EXEC sys.sp_cdc_enable_db
EXEC sys.sp_cdc_enable_table @source_schema = N'dbo'
	,@source_name = N'foo'
	,@role_name = NULL
	,@filegroup_name = N'primary'
	,@supports_net_changes = 1
EXEC sys.sp_cdc_disable_table @source_schema = N'dbo'
	,@source_name = N'foo'
	,@capture_instance = N'ALL'
EXEC sys.sp_cdc_disable_db

As soon as the above was done, we could rename the column.

Have you encountered any such weird situations where the error message was not correct due to metadata problem?

Reference: Pinal Dave (https://blog.sqlauthority.com)


Change Data Capture, SQL Replication, SQL Scripts, SQL Server
Previous Post
SQL Server – PowerShell Script – Getting Properties and Details
Next Post
SQL SERVER 2016 – Trace Flag 1117 is Discontinued. Use the Options Provided with ALTER DATABASE

Related Posts

1 Comment. Leave new

  • We are getting the same error but its in legacy environment(SQL 2000). Checked that the column which we are trying to update is not a part of replication still we are getting the below error

    Msg 4929, Level 16, State 1, Line 1
    Cannot alter the table ‘xxxxxxx’ because it is being published for replication.

    Can someone please assist here? Thanks


Leave a Reply