www.webdeveloper.com
Results 1 to 5 of 5

Thread: have 9 million rows HELP!!!!!

  1. #1
    Join Date
    Sep 2006
    Location
    Cleveland
    Posts
    579

    have 9 million rows HELP!!!!!

    I need to get rid of 5 milliom rows from this table. It is contained in sql server 2005. I try a limited delete statement buyt get nothing but time outs. How can I get rid of these extra rows. My plan is to write a stored procedure that has a timer on it to execute every month or so. But I need to get rid of these rows in the mean time. Thanks for the reply.

  2. #2
    Join Date
    Jul 2005
    Location
    South Carolina
    Posts
    395
    How many records are not going to be deleted?
    I can solve differential equations and build huge databases, but I have no idea how to change my oil.

  3. #3
    Join Date
    Sep 2006
    Location
    Cleveland
    Posts
    579
    I only want rows that are a year old or newer. Thanks for the reply. I tried an sql atatement but a time out keeps happening. Any suggestions.

  4. #4
    Join Date
    Jul 2004
    Posts
    300
    delete top 5000 from table where <criteria>
    while @@rowcount > 0
    begin
    delete top 5000 from table where <criteria>
    end

  5. #5
    Join Date
    Sep 2006
    Location
    Cleveland
    Posts
    579
    mattyblah

    I wrote a tiny stored proc that deleted on month of data at a time. it took a long time for the first few time I executed this proc but once it started to go faster I wrote to delete several months at a time. I am slowly chewing away at this data. Thanks for the posts.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles