Expert Answer Center > Experts On Demand > View Answer
EMAIL THIS
Experts on Demand
  EXPERTS ON DEMAND HOME     POSE A QUESTION     VIEW ANSWERS     BROWSE BY TOPIC        RSS FEEDS  
What is data purging? What technology or method can I use to purge data in SQL Server 2000? QUESTION POSED ON: 18 JUL 2005
QUESTION ANSWERED BY: Rudy Limeback Data purging is deleting data that you no longer want. In SQL Server 2000, or in fact in any database system, the very first step is to make sure you have a copy of it, because you might want to restore it some day.

There are many ways to make sure you have a copy of your data. For example, you can back up the entire database. Or you could take a copy of only those rows about to be purged. In SQL Server, you have the very handy SELECT INTO FROM syntax:

select *
  into old_accounts_2003
  from current_accounts
 where account_lastactive < '2004-01-01'
Once that's done, you can go ahead and delete:
delete
  from current_accounts
 where account_lastactive < '2004-01-01'
Remember, always make sure you can restore it before you purge it.
HomeExperts on DemandIT Expert Webcast SeriesExpert KnowledgebaseSite Index
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts