Friday, February 24, 2012

Creating MSins / MSdel / MSupd

Hi Guys,
Need you help on this one.
I have a eplicated database that is rather large (1GB+), and I am getting
more and more requests to alter articles in the existing publication. As
there is lots of data I am having to carry out the following:
1.) drop the article
2.) drop the subscription of the article
3.) alter the table at the publisher
4.) add the article via t-sql
5.) add the subscription via t-sql
However, ... I am always left manually editing the MSins / MSdel and MSupd
stored procedures.
Is there an easy method for creating these automatically one an article has
been 'tweaked' so that the replication stored procedures are always correct
?
Any help on this would be greatly appreciated.
Regards,
David Mash
you should be using sp_repladdcolumn or sp_repldropcolumn for making schema
changes.
If for whatever reason you can't you can always quickly create a dummy
publication holding your article you just modified and then use
sp_scriptcustomprocs
for instance here is an example of doing this for the authors table
use pubs
sp_addpublication 'dummy'
go
sp_addarticle 'dummy','authors','authors'
go
sp_scriptpublicationcustomprocs dummy
go
--in the results pane copy out the procs and apply them on your subscriber
sp_droppublication 'dummy'
go
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"SplinX" <davidfmash@.hotmail.com> wrote in message
news:cjjukc$uoa$1@.kermit.esat.net...
> Hi Guys,
> Need you help on this one.
> I have a eplicated database that is rather large (1GB+), and I am getting
> more and more requests to alter articles in the existing publication. As
> there is lots of data I am having to carry out the following:
> 1.) drop the article
> 2.) drop the subscription of the article
> 3.) alter the table at the publisher
> 4.) add the article via t-sql
> 5.) add the subscription via t-sql
> However, ... I am always left manually editing the MSins / MSdel and MSupd
> stored procedures.
> Is there an easy method for creating these automatically one an article
has
> been 'tweaked' so that the replication stored procedures are always
correct
> ?
> Any help on this would be greatly appreciated.
> Regards,
> David Mash
>

No comments:

Post a Comment