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

sql server replication

group:

sp_repladdcolumn on Indexed View


sp_repladdcolumn on Indexed View ChrisR
8/4/2004 4:24:59 PM
sql server replication:
sql2k sp3

I know this itself cant be done. But say Im replicating to
a denormalized table via Indexed View. I now want to add a
new coulmn to that table and have it end up on both the
source and Publisher and the Subscriber. The only way Ive
found is to:

Add it to both tables. Include it in the Indexed View.
Mofify the insert and update stored procs generated by
replication. Is there a better way?

Re: sp_repladdcolumn on Indexed View ChrisR
8/5/2004 7:52:40 AM
Thanks guys.

Whats a Custom Sync Object?


[quoted text, click to view]
Re: sp_repladdcolumn on Indexed View Hilary Cotter
8/5/2004 8:34:02 AM
There are two options when you are replicating to an object on the publisher
to a subscriber where the schemas are different.

1) replicate an indexed view
2) create a custom sync object, and a creation script using sp_addarticle.
You need to build custom stored procedures and deploy them on your
Subscriber. Such a solution will allow you to add and drop new columns to
the table on the publisher and have them replicated to the subscriber.

As you have chosen the indexed view route, your steps that you have outlined
seem to be correct.

--
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html


[quoted text, click to view]

Re: sp_repladdcolumn on Indexed View ChrisR
8/5/2004 9:26:32 AM
Thanks Hilary.


[quoted text, click to view]
Re: sp_repladdcolumn on Indexed View Paul Ibison
8/5/2004 9:43:27 AM
Chris,
your method sounds correct to me.
Regards,
Paul Ibison

Re: sp_repladdcolumn on Indexed View Hilary Cotter
8/5/2004 10:56:34 AM
when replication generates the snapshot it uses a sync object or a view to
bcp the data out of. It doesn't bcp the data directly from the underlying
object, rather indirectly through the sync object - which is a view.

Sync objects look like this:

syncobj_0x3736454643413046

You are free to tell SQL Server to use an object of your own creation to bcp
the data from. You use the @sync_object parameter of sp_addarticle for this.

--
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html


[quoted text, click to view]

AddThis Social Bookmark Button