Considerations for delete

  • Hi everybody, I want to create a store procedure that will be executed daily, this SP have to delete data from 28 tables with antique of 3 months. Is there considerations for create the script of delete? I want that script not affect the perfomance of the server.

    Thanks for your help

  • Hi

    How many records are we talking here, are all this 28 tables are in same database. 🙂

  • Hi, We are talking of a range of 3800 to 4000 records aprox in total.

  • 3-4K total from all 28 tables? I don't think you have big worry about still recommend you to do it off hours. Because when deleting data indexes will be affected also.

    Mohit.

    [font="Arial"]---

    Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN[/url].
    Microsoft FTE - SQL Server PFE

    * Some time its the search that counts, not the finding...
    * I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing. :smooooth:[/font]

    How to ask for help .. Read Best Practices here[/url].

  • Better to do that deletion at off hours, you may minimize that problem. After deleting tables rebuild the indexes.

  • I wouldn't think that deleting 3-4k records among 28 tables would put indexes too far out of whack either, unless you're deleting only a few records from most of the tables, and then blowing away one or two tables for the most part. You should give us the rowcount approximations for these tables. Simply test the script on copies of the production tables in you dev environment, and check it out using sys.dm_db_index_physical_stats.

    Lee

  • Thanks to everybody!!!

    Now I going to add a job that execute a delete scheduled

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply