Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Rename disabled CDC column with sp_rename?

$
0
0

The script below seems to work fine in SQL Server 2008 R2 SP1 (Enterprise Edition), but not in SP2.
Is this a bug?

Ivar

use master
go

create database CdcTestDb
go

use CdcTestDb
go

exec sys.sp_cdc_enable_db
go

create table Tab (col1 int not null primary key, col2 varchar(10) null)
go

exec sys.sp_cdc_enable_table
@source_schema = N'dbo',
@source_name   = N'Tab',
@role_name     = NULL
GO

exec sys.sp_cdc_disable_table
@source_schema = N'dbo',
@source_name   = N'Tab',
@capture_instance = 'all'
GO

exec sp_rename N'dbo.Tab.col2', N'col2b', N'COLUMN';
-- Msg 4928, Level 16, State 1, Procedure sp_rename, Line 547
-- Cannot alter column 'col2' 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.


Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>