SQL Server Data Archiving
I am wondering if there is a quick simple method of archiving partial data from a sql server db? Is the easiest method via scripting or is there another more direct method? Yes I am new to DBA methods. Any help greatly appreciated.
[232 byte] By [
TonyH] at [2007-12-17]
Look at the DELETE statement in Books Online. For example, if you have a date column in the table you can do:
delete tbl
where datecol < '2005-09-07'
Note that DELETE removes the data from the table/database so you cannot retrieve it back without having a backup of the database. The command-line options for BCP utility is also present in Books Online. With that utility you can backup the data before deleting or you can use traditional database backup/recovery mechanisms.