December 20, 2010 at 8:12 am
Dear All,
Is there any option to pause the query and resume later if it takes more time to finish?
Please advise.
Thanks and Regards,
Ravichandra.
December 20, 2010 at 8:38 am
You can't do it in the middle of a statement, however you can do it between statements in a batch with this code :
WAITFOR DELAY '00:00:03'
WAITFOR TIME '12:34:56'
December 20, 2010 at 1:27 pm
But understand, you're holding open the transaction, locking resources, possibly blocking other users while that wait is in place. It could be a very dangerous thing to do.
What exactly is the problem here?
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 20, 2010 at 8:53 pm
ravisamigo (12/20/2010)
Dear All,Is there any option to pause the query and resume later if it takes more time to finish?
Please advise.
Thanks and Regards,
Ravichandra.
IF somecondition is true WAITFOR TIME 'hh:mm:ss'
Of course, that assumes that you didn't write it all as one big honkin' query to begin with. You could do partial processing with a "control loop" as many folks do with large DELETE's.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2010 at 8:54 pm
Agh! Gotta remember to read down. Remi already suggested what I just did.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply