all groups > sql server replication > march 2004 >
You're in the

sql server replication

group:

Alter Column Size of replicated column


Alter Column Size of replicated column Tony Fryer
3/12/2004 6:45:48 PM
sql server replication:
I'm trying to figure out how I can alter the size of a
column (e.g. increase a varchar(10) column to varchar(50))
when the column is part of a replicated column.
We use merge replication between SQL2000 and SQLCE on
PocketPC devices. It is important that the subscribers be
unaffected by the change (don't want them to have to
reinitialise their subscription).

So far all I have come up with is a clunky approach. Run
the following:
sp_repladdcolumn - add a dummy varchar(50) column
copy existing column data to new column
sp_repldropcolumn - drom the existing varchar(10) column
sp_repladdcolumn - re-add the column with same name as
original column but varchar(50)
copy data from dummy column to new column
sp_repldropcolumn - drop dummy column

This works fine as long as the column is nullable and has
no constraints/indexes.

If I try this with an indexed column the publisher is
fine. However the subscriber fails with a 'Bad or Invalid
SQL statement' and 'The provider could not drop the object'

I'm guessing that although I dropped the index (and re-
created it) on the publisher it was unable to drop the
original column on the subscriber because the index was
still there.


Can anyone tell me if it is even possible to alter a
replicated column? or do I have to drop/recreate the
Re: Alter Column Size of replicated column Paul Ibison
3/13/2004 7:55:17 AM
The 'clunky approach' is the standard workaround (currently). In Yukon this
will be possible directly.
To first drop constraints/indexes, you can use sp_addscriptexec.
HTH,
Paul Ibison



[quoted text, click to view]

Re: Alter Column Size of replicated column Hilary Cotter
3/13/2004 8:14:40 AM
Not really, what the NFR clause does is disable the identity property for
transactions generated by the replication processs.
[quoted text, click to view]

Re: Alter Column Size of replicated column Kyle McAdam
6/13/2004 12:47:03 AM
When you create an identity column(index) , you can add the Not For
Replication clause to de-activate the index.


[quoted text, click to view]

AddThis Social Bookmark Button