title: Return a string value from stored procedure
body: <p>I want to create a stored procedure to return the record counts in a number of other stored procedures.I have the following to create a string value:</p>
  
  <pre><code>ALTER PROCEDURE usp_Prepare_Default_Page 
      @Status int,
      @CurrentUser int,
      @DisplayUser int,
      @OwnRecords BIT = 0,
      @array VARCHAR(MAX) = '' OUTPUT
  AS
  BEGIN
      DECLARE @dgActions INT = 0
      DECLARE @dgAllocByMe INT = 0
      DECLARE @dgCompliance INT = 0
  
       EXEC uSp_myTask_CurrentTasks @Status, @CurrentUser, @DisplayUser, @OwnRecords
       SET @dgActions = @@rowcount
  
       EXEC uSp_myTask_ComplianceProcess @Status, @CurrentUser, @DisplayUser, @OwnRecords
       SET @dgCompliance = @@rowcount
       SET @array = CAST(@dgActions AS VARCHAR(10)) + ',' + CAST(@dgAllocByMe AS VARCHAR(10)) + ',' + CAST(@dgCompliance AS VARCHAR(10))
  
       select @array AS tabDataCounts
  END
  GO
  </code></pre>
  
  <p>When this is executed within SQL Server Management Studio each of the executed stored procedures is displayed along with my string value. </p>
  
  <p>When I execute the stored procedure in my ASP.Net application I only get the data from the first stored procedure.</p>
  
  <p>Can anyone advise how to get just the string value?</p>
  
  <p>Thanks</p>
  
  <p>James</p>