Groups | Blog | Home
all groups > sql server replication > june 2006 >

sql server replication : Resize column during replication


Philippe
6/13/2006 2:05:02 PM
Hello,

How do I do to resize a column in a replicatied table on the publisher,
without dropping curent replication ?

Paul Ibison
6/16/2006 7:41:19 PM
Philippe,
assuming the question concerns sql server 2000:
http://www.replicationanswers.com/AddColumn.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Paul Ibison
6/27/2006 12:00:00 AM
Hi Philippe - this can't be used to resize a column directly, but does form
part of the workaround solution:

exec sp_repladdcolumn @source_object = 'tEmployees'
, @column = 'TempForename'
, @typetext = 'varchar(100) NULL'
, @publication_to_add = 'tTestFNames'

update tEmployees set TempForename = Forename

exec sp_repldropcolumn @source_object = 'tEmployees'
, @column = 'Forename'

exec sp_repladdcolumn @source_object = 'tEmployees'
, @column = 'Forename'
, @typetext = 'varchar(100) NULL'
, @publication_to_add = 'tTestFNames'

update tEmployees set Forename = TempForename

exec sp_repldropcolumn @source_object = 'tEmployees'
, @column = 'TempForename'


NB this is VERY easy in SQL Server 2005, where Alter Table on the publisher
is sufficient :)

Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Karthik
6/27/2006 3:22:01 AM
Use sp_repl_add_column

[quoted text, click to view]
AddThis Social Bookmark Button