title: DTC not working when two transactions are being executed
body: <p>I'm working on SQL Server 2008 and I'm trying to execute a stored procedure which updates a table and executes another stored procedure on a linked server.</p>
  
  <p>The point is it works when no update is made, just like this:</p>
  
  <p>[test_DTC] on [Server1]</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[test_DTC] 
  @UserId int,
  @Status tinyint
  AS
  BEGIN
  
      EXEC [Server2].[Database].[dbo].[test_DTC];
  
  END
  
  GO
  </code></pre>
  
  <p>[test_DTC] on [Server2]</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[test_DTC] 
  
  AS
  BEGIN
  
      PRINT 'Done'
  
  END
  
  GO
  </code></pre>
  
  <p>Execute on Server1:</p>
  
  <pre><code>EXEC [test_DTC]
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Done
  </code></pre>
  
  <p>But when I include the UPDATE on Server1 procedure, it fails.</p>
  
  <p>[test_DTC] on [Server1]</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[test_DTC] 
  @UserId int,
  @Status tinyint
  AS
  BEGIN
  
      UPDATE 
         Users
      SET 
         Status=@Status
      WHERE 
         UserId=@UserId;
  
      EXEC [Server2].[Database].[dbo].[test_DTC];
  
  END
  
  GO
  </code></pre>
  
  <p>[test_DTC] on [Server2]</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[test_DTC] 
  
  AS
  BEGIN
  
      PRINT 'Done'
  
  END
  
  GO
  </code></pre>
  
  <p>Execute on Server1:</p>
  
  <pre><code>EXEC [test_DTC]
  </code></pre>
  
  <p>Result</p>
  
  <pre><code>Provider OLE DB "SQLNCLI10" from linked server "[Server2]" returned message "The transaction has already been implicitly or explicitly committed". Msg 7391, Level16, State 2, Procedure [Server2].[Database].[dbo].[test_DTC], Line 19
  
  The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "Server2" was unable to begin a distributed transaction.
  </code></pre>
  
  <p>Thanks for your help</p>