Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #286

strange behavior with SP

From Wishmaster <"sysadmin.rock[SINESTO]"@gmail.com>
Newsgroups comp.databases.ms-sqlserver
Subject strange behavior with SP
Date 2011-05-05 11:54 -0300
Organization Newsgroup.cl News Server
Message-ID <ipudmv$agt$1@news.newsgroup.cl> (permalink)

Show all headers | View raw


Hi everyone,

I got this situation, I got a stored procedure that for some reason 
after using it for some period of time (maybe a day or two)  stops 
sending results, but  if I change the position of the condition (where) 
on the first line then begins to work ok.  This solution works a day or 
two but the issue arise again and I must change the line to it's 
original version, completing this weird cycle.  have you ever seen this 
kind of behavior before?
The first commented line is what i need to change time to time...
			

	--Where (Cr.ID_Credito = @ID_Credito Or @ID_Credito = 0)
	Where (@ID_Credito = 0 Or Cr.ID_Credito = @ID_Credito)
	And		(Co.Rut_Cliente = @Rut_Cliente Or @Rut_Cliente = '')
	And		(Cr.Estado_Credito = @Estado_Credito Or @Estado_Credito = '')
	And		(Cr.Confirmado= @Confirmado or @Confirmado='')
	And 	(Cr.Estado_Credito in 
('CP','AN','CE','CA','EO','AC','CO','CR','CD','JU'))
	And	(Cr.Rut_Empresa = @Rut_Empresa Or @Rut_Empresa = '')
	and (Co.Codigo_Local=@Codigo_Local or @Codigo_Local=0)
	and	(Cr.Automotora=@Rut_Automotora or @Rut_Automotora='')
	and (PE.Rut_persona=@Rut_Persona or @Rut_Persona='')
	and	(Cr.Confirmado = @Confirmado or @Confirmado='')
	and	(Cr.Garantizado = @Garantizado or @Garantizado='')	
	

Thanks.
Diego.

ASP, Com+
SQL Server 2005 SP3

Back to comp.databases.ms-sqlserver | Previous | NextNext in thread | Find similar


Thread

strange behavior with SP Wishmaster <"sysadmin.rock[SINESTO]"@gmail.com> - 2011-05-05 11:54 -0300
  Re: strange behavior with SP Erland Sommarskog <esquel@sommarskog.se> - 2011-05-05 23:56 +0200
    Re: strange behavior with SP Wishmaster <"sysadmin.rock[SINESTO]"@gmail.com> - 2011-05-06 17:22 -0300
      Re: strange behavior with SP Erland Sommarskog <esquel@sommarskog.se> - 2011-05-06 23:52 +0200
        Re: strange behavior with SP Wishmaster <"sysadmin.rock[SINESTO]"@gmail.com> - 2011-05-09 14:55 -0400
          Re: strange behavior with SP Henk van den Berg <hvandenberg@xs4all.nl> - 2011-05-09 21:20 +0200
            Re: strange behavior with SP Wishmaster <"sysadmin.rock[SINESTO]"@gmail.com> - 2011-05-09 16:45 -0400
          Re: strange behavior with SP Erland Sommarskog <esquel@sommarskog.se> - 2011-05-09 23:52 +0200

csiph-web