sql - using SET NOCOUNT ON is affecting the result value returned from a stored procedure -


having following script storedprocedure..

create procedure [dbo].[getinvestorforextractreport]     -- add parameters stored procedure here     @rptprm_accountnumber varchar(8000),     @settlmentdate datetime encryption      -- set nocount on added prevent result sets     -- interfering select statements.     set nocount on;      -- insert statements procedure here     select distinct         i.investorid,          i.investorname [nombre inversionista],         substring(ia.accountnumber,1,3) accountnumber,         isnull(agsl.cashguarantee,0) [garantia efectivo],         i.documenttype [tipo documento],         i.documentnumber [numero documento],         substring(i.mainaccount,1,3) [cuenta crcc],         i.internalinvestornumber [cuenta interna],         substring(convert(varchar,getdate(),120),1,10) [fecha],         isnull(agsl.investorcashguarantee,0) [efectivo]              investors         inner join investoraccounts ia              on (i.investorid = ia.investorid , ia.accountnumber '%01' ,             (substring(ia.accountnumber,1,3) in (select param  dbo.fn_reportparams(@rptprm_accountnumber,','))))         left join accountguaranteestatuslog agsl             on (agsl.investoraccount = substring(ia.accountnumber,1,3)                 , datediff(dd,agsl.settlmentdate ,@settlmentdate)=0)     order substring(ia.accountnumber,1,3) go 

if set nocount on removed, , stored procedure executed same parameters value of column [efectivo] changes! how possible?

if try run stored procedure in ssms, data results should same regardless of whether nocount on or off. if see results different may coincidence in timing of actions.

the difference coming stored procedure: (494 row(s) affected)

when executed program, typically second data set returned, value.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -