Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create replication subscriptions to and SQL Server 2008 R2 via a script. There are 3 subscribers so this script creates the subscriptions by calling


and then


with the required parameters for each subscriber. The only thing I have not accomplished so far is to tell the sp_addmergepushsubscription_agent that I wish to set the PollingInterval to 30 seconds instead of the default 60 seconds. What parameters need to be changed in order to do the trick?

share|improve this question

You need to set the PollingInterval Merge Agent parameter in the replication agent profile after you create your subscription and your subscription agent.

Have a look at Work with Replication Agent Profiles.

share|improve this answer
I know how to do this from the UI of the Management Studio. I'd just like to do it from within the scripts so i can avoid after running them to have to go to the replication agent of each subscriber and change this value. – Wanderer Nov 15 '13 at 11:33
See the section Using Transact-SQL in the link: You need to look at sp_help_agent_profile and sp_change_agent_profile. – Brandon Williams Nov 15 '13 at 17:43
Thanks for the links. So, in a blank query window, i enter this: "sp_change_agent_profile 6, '-PollingInterval', 30" and i get this: "Msg 21183, Invalid property name '-PollingInterval'" Any idea why would this be happening? – Wanderer Nov 28 '13 at 14:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.