April 16, 2003 at 7:45 am
1. I need to build a delete statement, which doesn't run in a single transaction. E.g. statement:
DELETE FROM <Table> WHERE DateStart < GetDate()
runs in a single transaction, and rolls back, if fails. The statement should delete rows immediately w/o using commitment control. I know, it can be done using a cursor, or DELETE TOP 100, and WHILE loop, but I would like to use the simple DELETE. I assume, there is a way to turn off the commitment control for a single statement, but haven't found a way.
2. This is related to the previous DELETE. It should run on low priority in the SQL Server, so it wouldn't affect other activities. I've looked for a way to set the priority of a task, but no luck. What I've found is a way to say, that if a deadlock occurs, my statement is the one to die first, but that's not enough.
April 16, 2003 at 8:24 am
Not answering your question, but I like deleting x records at a time. Delete a million records in one transaction, transaction log gets huge. Better to do in chunks.
Andy
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply