August 29, 2010 at 8:53 pm
I have a job that I expect to take a couple of days to run. It's a DTS package, transferring 16,000,000 records (in batches of 25,000 records), based on the following logic:
select * from MyDatabase..MyTable with (NOLOCK)
where StartDate < cast(FLOOR(cast(getdate() -367 as float)) as datetime)
I assume the value in GETDATE remains constant from the time the jobs starts, regardles of the fact that it's transferring data in batches.
Correct ?
August 29, 2010 at 8:57 pm
GETDATE wont remain constant even if it is in a loop... if you want to maintain that as constant, store it in a varibale before the loop and then use that variable inside the loop..
August 30, 2010 at 4:45 am
Thanks for the reply. I should clarify that I'm not using a loop. It's just the 1 statement above. The 25,000 batch size is specified in the properties tab in the DTS transformation step.
Using a variable might be a good idea anyway.
August 30, 2010 at 7:23 am
Agreed. If the date mustn't change, then storing it in a variable is definitely the way to go just to be on the safe side.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply