Take the 2-minute tour ×
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. It's 100% free, no registration required.

I'm 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

sp_addmergesubscription

and then

sp_addmergepushsubscription_agent

with the required parameters for each subscriber. The only thing i haven't 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
add comment

1 Answer 1

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: technet.microsoft.com/en-us/library/ms152515.aspx 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
add comment

Your Answer

 
discard

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.