Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

How to alter replicated column

$
0
0

I want to change the length of a replicated column. I ran this:

exec  sp_articlecolumn 
    @publication = N'DIONLINE-SQL2014'
    , @article = N'Valuation'
    , @column = N'WallConstruction'
    , @operation = N'drop'
    , @force_invalidate_snapshot = 1
    , @force_reinit_subscription = 1

Result: (1 row(s) affected)

Then this

alter table Valuation.Valuation
  alter column WallConstruction varchar(255) null

Result: Msg 4928, Level 16, State 1, Line 1 Cannot alter column 'WallConstruction' because it is 'REPLICATED'.

I've successfully used a very similar approach to perform a very similar task - altering the Valuation.Valuation.RoofConstruction column (except I removed that column from the publication via the UI) - so I'm puzzled why this won't work.

I plan eventually to add the column back into the publication.

What's going on here, or where do I look to find out?

Edit

Luckily the column I was trying to alter had not yet received any values, so I was able to do this:

alter table Valuation.Valuation
  drop column WallConstruction

alter table Valuation.Valuation
  add WallConstruction varchar(255) null

but that doesn't really seem like the most useful answer. So if anyone has a better solution...


Viewing all articles
Browse latest Browse all 17268

Trending Articles



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