Re: Timeout problem when move large number of files
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 01/13/05
- Next message: Carl Howarth: "Re: UDF problems"
- Previous message: Mike Epprecht (SQL MVP): "RE: Data Export T-SQL to Excel"
- In reply to: David: "Timeout problem when move large number of files"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 Jan 2005 10:29:01 +0100
On Thu, 13 Jan 2005 05:20:06 -0400, David wrote:
>Do you know some way to avoid the timeout?
Hi David,
I agree with Mike. Another idea is to drop the trigger, instead, change
the procedure that performs the cleanup to
declare @cutoff datetime
set @cutoff = DateAdd(dd,-1, getdate())
begin tran
Insert into DbLog.dbo.his_Transactions (col1, col2, ...)
select col1, col2, ...
from Transactions
where receivedtime < @cutoff
Delete from Transactions
where receivedtime < @cutoff
commit tran
This will decrease the time that the transactions table is locked, because
the copying (that doesn't need to lock the date) is done before the
delete.
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Carl Howarth: "Re: UDF problems"
- Previous message: Mike Epprecht (SQL MVP): "RE: Data Export T-SQL to Excel"
- In reply to: David: "Timeout problem when move large number of files"
- Messages sorted by: [ date ] [ thread ]