stored proc bug with datetime variable
- From: "ujjc001" <ujjc001@xxxxxxxxx>
- Date: 13 Sep 2006 08:06:38 -0700
two variables declared in my proc:
@DATE_RANGE_START as datetime,
@DATE_RANGE_END as datetime,
When I execute my SP it takes 34 seconds.
When I change the variables to:
@DATE_RANGE_START1 as datetime,
@DATE_RANGE_END1 as datetime,
and add this to my sp:
declare @DATE_RANGE_START datetime
declare @DATE_RANGE_END datetime
set @DATE_RANGE_START = @DATE_RANGE_START1
set @DATE_RANGE_END = @DATE_RANGE_END1
the SP runs in 9 seconds (which is expected)
Passing in '1/1/01' and '1/1/07' respectivly.
Everything else is equal and non-important to this problem.
Why does it take 34 seconds when I use the variables from the input
parameters?
Interesting isn't it.
Jeff
.
- Follow-Ups:
- Re: stored proc bug with datetime variable
- From: Erland Sommarskog
- Re: stored proc bug with datetime variable
- From: Gert-Jan Strik
- Re: stored proc bug with datetime variable
- From: ujjc001
- Re: stored proc bug with datetime variable
- Prev by Date: export to sql 2005
- Next by Date: Re: stored proc bug with datetime variable
- Previous by thread: export to sql 2005
- Next by thread: Re: stored proc bug with datetime variable
- Index(es):
Relevant Pages
|