Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5982009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:01:32+00:00 2026-05-22T22:01:32+00:00

I have a SQL Server database running in Full recovery. I need to remove

  • 0

I have a SQL Server database running in Full recovery. I need to remove data (around 30-40 million records) but I cannot take the database offline as it’s in constant use. I also cannot switch it to Simple recovery mode incase anything happens and we lose live data. When I try to remove the data in small chunks (around 2 million rows), the transaction log becomes extremely large and causes the process to become extremely slow. Due to back-up jobs running at night, I only have a small timeframe.

Does anyone have any thoughts on how I can do this? I thought about copying the table into another database (in Simple recovery mode) and then remove the data. Is this a good idea?

There are 3 tables in question. Campaign, Events and Targets. Its the Events table that has the millions of records in and this is what takes the time to delete. The all have the necessary relations via Id columns.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:01:33+00:00Added an answer on May 22, 2026 at 10:01 pm

    You have to use small chunks otherwise your transaction log will increases

    Every one one of 30-40 million deletes will be logged. If you create a new table and copy “to keep” rows you’ll still have 50+ million logged rows. The fact of simple vs full recovery doesn’t matter: each delete/insert is logged

    If the log increases in simple recovery then I suspect you are doing it in a transaction. So the 30-40 million deletes are still logged, even in simple recovery because it would all have to be rolled back perhaps.

    For 40 x 1 million deletes without a transaction in simpler recovery you can use CHECKPOINT to assist in log tidy up

    See Bulk DELETE on SQL Server 2008 (Is there anything like Bulk Copy (bcp) for delete data?) for more

    But something like:

    SELECT 'Starting' --sets @@ROWCOUNT
    WHILE @@ROWCOUNT <> 0
    BEGIN
        CHECKPOINT
        --Edit: must be last to set @@ROWCOUNT
        DELETE TOP (1000000) MyTable WHERE ...
    END
    

    Process:

    • full backup
    • change recovery to simple
    • delete
    • change recovery to full (or what it was before)
    • full backup

    You don’t have many other options if you insist on deleting 30+ million rows in one go in a short windows…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume that you have a running SQL Server Express instance named (local)\SQLEXPRESS. Its database
We have a SQL server database. To manipulate the data non-programmatically, I can use
I have a SQL Server 2000 database with around a couple of hundred tables.
I have a database running on MS SQL Server 2005 and an ASP.NET 3.5
We have a database server running SQL Server 2008 and we connect using Windows
We have SQL Server database setup. We are setting up a replication scenarios where
I have an SQL server database that I am querying and I only want
I have a SQL Server 2005 database and I have 4 GB of text
I have a SQL Server 2005 database that is suffering from lock starvation because
I have a SQL Server 2000 database instance that is rarely updated. I also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.