Wednesday, March 28, 2012

replication system stored procedures parameter defaults ?

Hi there

This is a pretty straight forward question.

When using sp_droparticle or sp_changepublication etc, basically any replication system stored procedure.

There are many parameters for these sp's basically all i want to know is if i provide the relavant paramaters,that is publication name, subscriber name , specific parameter i wish to change etc, are all the other paramters defaulted to the current publication/subscriber properties.

In other words sometimes i really dont know what to provide for all the parameters i am pretty sure as long as i provide the necessary ones the other ones are defaulted correctly, BOL is not 100% clear on all the parameters ?

ThanxHi Sean,

You are right. If you dont specify a parameter value in a stored procedure, it will get set to the default value.

But when you call a sp_change*** procedure, only parameters you have specified will be changed. Others will continue to be set to what they were (They will not be reset to the default values)

For Eg: you call:

sp_addpublication @.publication='testPub', @.allow_push='true', @.allow_pull='true', @.allow_anonymous='true'

[Note that defaults for @.allow_pull and @.allow_anonymous are false]

And now if you call:

sp_changepublication @.publication='testPub', @.allow_pull='false'

this call will only set @.allow_pull='false' and will not touch @.allow_anonymous. It has already been set to 'true' and it will continue to be true.|||Hi Mahesh

Yes that helps thanx.
I had a problem with sp_addarticle i did not specify push or pull because i thought it would look at the subscriber and stay at pull, but it automatically defaulted to push, which i found strange as the subscriber/publication relationship was pull ?

Thanx|||Hi Sean, subscription-type has nothing to do with sp_addarticle, did you reference the wrong stored procedure name in your post?

Assuming you meant to say sp_addsubscription, if you look it up in Books Online, for parameter @.subscription_type, the default is PUSH. This is the only place where you can assign a subscription to be push or pull.
|||Hi Greg

Yes sorry i meant sp_addsubscription.

No comments:

Post a Comment