View Single Post

   
  #2 (permalink)  
Old 02-29-2008, 07:11 AM
Steve Jorgensen
 
Posts: n/a
Default Re: How can I avoid table lock in SQL2000?

On 15 Feb 2005 13:19:01 -0800, "gdekhayser" <gdekhayser@voyantinc.com> wrote:

>To any and all;
>
>I have a very large table (16Mil+ records), for which I want to delete
>about 8 Million records. There are a few indexes on this table.
>
>Is there a way that I can run either a query or a series of queries
>that will run against each record and delete based on criteria (date)?
> If I do a single DELETE query, it will take forever, lock the table,
>and my app that runs against it will stop INSERTING, which is bad.
>
>If I do a cursor, I think it locks the table also, so that won't do,
>right?
>
>Any help would be appreciated.
>
>Glenn Dekhayser
>Contentcatcher.com


With a table that size, have you thought of partitioning it by date? Then,
locks would be held only on the partition(s) that overlap the date range you
are deleting.
Reply With Quote