Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Best Practice to delete data from tables

Author  Topic 

AlanPBates
Starting Member

34 Posts

Posted - 2010-05-26 : 10:36:37
Our application collects data in about 100 tables. For archiving purposes we insert the data into 5 tables on a trigger based event.

What is the best practice to delete the data from the 100 tables without compromising the CPU load on the CPU ?

The OS is Server 2003 R2.

Thanks,

Alan.

Kristen
Test

22859 Posts

Posted - 2010-05-26 : 11:27:37
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=141065#553313
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=77084#279816
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83525
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=85620
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=62356
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72804

Should keep you going for a bit!
Go to Top of Page

Asken
Starting Member

38 Posts

Posted - 2010-05-27 : 03:28:10
If you want to clean it all out from the 100 tables just truncate the tables. You will however need to disable all foreign keys on the tables you want to empty. Once truncation is done enable the foreign keys again.

Definately the fastest and least intense way.


Reporting & Analysis Specialist
Helping others helps me get better...
Go to Top of Page
   

- Advertisement -