title: using SET NOCOUNT ON is affecting the result value returned from a stored procedure
body: <p>Having the following script for a StoredProcedure..</p>
  
  <pre><code>CREATE PROCEDURE [dbo].[GetInvestorForExtractReport]
      -- Add the parameters for the stored procedure here
      @rptPrm_AccountNumber varchar(8000),
      @SettlmentDate as datetime
  with encryption
  AS
  
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;
  
      -- Insert statements for procedure here
      SELECT distinct
          I.InvestorID, 
          I.InvestorName As [Nombre Inversionista],
          substring(IA.AccountNumber,1,3) accountnumber,
          isnull(AGSL.CashGuarantee,0) As [Garantia Efectivo],
          I.DocumentType As [Tipo Documento],
          I.DocumentNumber As [Numero Documento],
          substring(I.MainAccount,1,3) As [Cuenta CRCC],
          I.InternalInvestorNumber As [Cuenta Interna],
          SUBSTRING(CONVERT(VARCHAR,getdate(),120),1,10) As [Fecha],
          isnull(AGSL.InvestorCashGuarantee,0) As [Efectivo]
      FROM 
          Investors I
          INNER JOIN investoraccounts IA 
              ON (I.InvestorId = IA.InvestorId AND IA.AccountNumber like '%01' AND
              (substring(IA.AccountNumber,1,3) IN (select param from  dbo.fn_ReportParams(@rptPrm_AccountNumber,','))))
          LEFT JOIN AccountGuaranteeStatusLog AGSL
              ON (AGSL.InvestorAccount = substring(IA.AccountNumber,1,3)
                  AND datediff(dd,AGSL.SettlmentDate ,@SettlmentDate)=0)
      order by substring(IA.AccountNumber,1,3)
  GO
  </code></pre>
  
  <p>If <strong>SET NOCOUNT ON</strong> is removed, and the stored procedure is executed with the same parameters the value of the column <code>[Efectivo]</code> changes! How is that possible? </p>