title: Get ROWCOUNT of SYSTEM PROCEDURE IN SYBASE ASE 12.5
body: <p>I need to check for a named transaction in another procedure to ensure it has not been executed by anyone else.</p>
  
  <p>But for this question I am trying to leverage a system procedure</p>
  
  <pre><code>EXEC sp_transactions 'xid','MyTran1'  -- This will return a result if it finds a named transaction called MyTran1
  </code></pre>
  
  <p>I would like know if it returned a row... RowsReturned > 1</p>
  
  <p>So I did the following</p>
  
  <pre><code>BEGIN TRAN MyTran1  -- named transaction
  BEGIN TRAN MyTran2  -- named transaction
  </code></pre>
  
  <p>If I run <code>EXEC sp_transactions</code> 2 rows are returned</p>
  
  <p>If I run <code>EXEC sp_transactions  'xid','MyTran1'</code> - one row is returned</p>
  
  <p>Now I need to do something like</p>
  
  <pre><code>DECLARE @nameTranFound int
  SET @nameTranFound = EXEC sp_transactions  'xid','MyTran1'
  </code></pre>
  
  <p>I tried using @@RowCount, but it always returns 1</p>
  
  <pre><code>EXEC sp_transactions 'xid','Warren1'
  SELECT @@RowCount
  </code></pre>