Tuesday, March 27, 2012

Few repl questions

Dear friends,
I have some small questions related to the replication please see if you can
help me.
1. I want to add a article in the merge replicaiton which i can do with
sp_addmergearticle procedure but i want that the snapshot should
automatically run after the same. Please also suggest can user keep on
working while adding and rerunning the snapshot.
2. How can i drop the Article while the replication is on.
3. Which procedure will allow me to Chnage teh Defination of the fields
while the replication is on.
4. How can i drop the Column while replication is on.
Thanks and best regards
Sharad
Sharad,
to add the article, use sp_addmergearticle. This way, you can use
sp_start_job to initiate the snapshot agent.
to drop the article using transactional, use :
exec sp_dropsubscription @.publication = 'tTestFNames'
, @.article = 'tEmployees'
, @.subscriber = 'RSCOMPUTER'
, @.destination_db = 'testrep'
exec sp_droparticle @.publication = 'tTestFNames'
, @.article = 'tEmployees'
(for transactional).
For merge, this is not possible and you'd have to drop the publication to be
able to do it.
To change the field definition in SQL Server 2000 look at this:
http://www.replicationanswers.com/AddColumn.asp
In SQL Server 2005, this should help:
http://www.replicationanswers.com/AlterSchema2005.asp
To drop a column, look at sp_repldropcolumn
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

No comments:

Post a Comment