all groups > sql server replication > may 2007 >
You're in the

sql server replication

group:

Altering a column on a NoSync Replicated Table


Altering a column on a NoSync Replicated Table BaniSQL
5/18/2007 10:45:00 AM
sql server replication:
Hi,
I saw an article on www.replicationanswers.com, about Altering a column on a
Replicated Table (from Paul Ibison):

exec sp_dropsubscription @publication = 'tTestFNames'
, @article = 'tEmployees'
, @subscriber = 'RSCOMPUTER'
, @destination_db = 'testrep'

exec sp_droparticle @publication = 'tTestFNames'
, @article = 'tEmployees'

alter table tEmployees alter column Forename varchar(100) null

exec sp_addarticle @publication = 'tTestFNames'
, @article = 'tEmployees'
, @source_table = 'tEmployees'

exec sp_addsubscription @publication = 'tTestFNames'
, @article = 'tEmployees'
, @subscriber = 'RSCOMPUTER'
, @destination_db = 'testrep'

I DID THE SAME FOR NO-SYNC INITITIALIZATION, BUT THE STRUCTURE OF THE FIELD
IN SUBCRIBER IS THE SAME, THIS CHANGE IS NOT BEING PUBLISHED IN THE
SUBSCRIBER.
CAN SOMEBODY HELP ME TO SOLVE THIS ISSUE FOR NO-SYNC INITIALIZATION, HOW THE
SCRIPT SHOULD LOOK LIKE OR WHAT DO IA HEVE TO DO?

Thanks,
Re: Altering a column on a NoSync Replicated Table Paul Ibison
5/18/2007 7:57:45 PM
It all depends on whether you want to do an automatic one or another nosync
one. The easiest way is to drop the article and subscription then readd it
as @sync_type = automatic.
Cheers,
Paul Ibison

Re: Altering a column on a NoSync Replicated Table BaniSQL
5/19/2007 4:37:03 AM
Isn't @sync_type = automatic the default one, I mean if you don't specify it
will take the automatic one. I tried like that, but than some foreign keys
referencing that table were firing.
I'm trying to alter a column, is not another way of doing it beside this one
droping the whole article and replicating again. This soltion is fine for me
as logn is it will work, but the problem is that the foeign keys are firing
and some related records to other related tables can't find.

Please help.

Thnx,
BaniSQL

[quoted text, click to view]
Re: Altering a column on a NoSync Replicated Table Paul Ibison
5/19/2007 10:19:51 PM
OK - in that case synchronize and then prevent access to the system. Drop
the subscription and article, add the column to both the publisher and
subscriber and then do a nosync initialization of the new article.
Cheers,
Paul Ibison

AddThis Social Bookmark Button