SQL Server Developer Center > SQL Server Forums > SQL Server Replication > How to determine a SP execution context (publisher/subscriber)?
Ask a questionAsk a question
 

AnswerHow to determine a SP execution context (publisher/subscriber)?

  • Wednesday, November 04, 2009 12:17 PMLaurentiuM Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I want to have slightly different behavior in the replicated stored procedure. Is there a way to determine that the SP is executing on the subscriber/publisher databases?

    LaurentiuM

Answers

  • Wednesday, November 04, 2009 9:28 PMGreg YMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    What specific proc are you talking about?  If it's a system proc, i.e. one that does setup/removal/administration, then no you cannot change it.  But if it's one of the ins/upd/del procs that get executed on the subscriber, then yes you can modify those.  You can create your own custom proc and reference it in sp_addarticle.

All Replies

  • Wednesday, November 04, 2009 9:28 PMGreg YMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    What specific proc are you talking about?  If it's a system proc, i.e. one that does setup/removal/administration, then no you cannot change it.  But if it's one of the ins/upd/del procs that get executed on the subscriber, then yes you can modify those.  You can create your own custom proc and reference it in sp_addarticle.