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.

We have a three server cluster using AlwaysOn technology, and have created an Availability Group for the SSISDB catalog.

How would you change the code to only execute on the primary server?

share|improve this question

closed as unclear what you're asking by swasheck, Mark Storey-Smith, Jon Seigel, billinkc, StanleyJohns Jul 18 '13 at 3:57

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Can you please define "the code"? –  Aaron Bertrand Jan 17 '13 at 16:00
add comment

1 Answer 1

If you're talking about accessing the primary replica (and the Availability Group database on the primary replica) at all times, this is where the Availability Group Listener comes into play.

See this quote from BOL on the topic:

You can provide client connectivity to the primary replica of a given availability group by creating an availability group listener. An availability group listener provides a set of resources that is attached to a given availability group to direct client connections to the appropriate availability replica.

So instead of referencing a particular server, by using the Listener you can be pointing at the current primary replica of the AG.

BOL reference on Availability Group Listeners

Edit: As per Aaron's comment below, you may be looking for more specifics surrounding the particular catalog DB (as opposed to generic handling as above). You can find more information regarding this on the MSDN SSIS blog here. If both of these points explained in this answer do not clear up your question, please clarify what exactly you're looking to do.

share|improve this answer
    
I think he means the SSIS code, but at the very least the question is ambiguous. –  Aaron Bertrand Jan 17 '13 at 15:56
    
@AaronBertrand Good point. I have edited and put a link to an MSDN blog post that may or may not answer his question. –  Thomas Stringer Jan 17 '13 at 16:01
add comment

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