title: How to execute stored procedure on Remote computer in an efficient way?
body: <p>I am running <code>StoredProcedure1</code> on Remote1 and once I get the output value from <code>StoredProcedure1</code> of Remote1, I will pass the value as a parameter for <code>StoredProcedure2</code> (available on Remote2).</p>
  <p>So, if I execute <code>StoredProcedure2</code> from Remote1 using</p>
  <pre><code>[Remote2].[db].[schema].[StoredProcedure]
  </code></pre>
  <p>will this <code>StoredProcudure2</code> really execute and process on Remote2 or Remote1?</p>
  <p>Or if I create the same stored procedure like <code>StoredProcedure2</code> on <code>Remote1</code> and update the records of Remote2 from Remote1, will it take the same time to run?</p>
  <p>Which one is the efficient way?</p>
  <pre><code>RemoteServer DB1
         (Stored Procedure1) @output1, @output2
  
  EXEC [RemoteDB2].[DB2].[dbo].[StoredProcedure2] 
                   @Para1 = @output1, @Para2 = @output2
  
               |
  
  RemoteServer DB2
         (Stored Procedure2) @Para1,@Para2
  </code></pre>