Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need a script to move older data from Test database to archive database. Suppose i have a db who's size is 10GB and it is getting full frequently,so i need a script, whenevr i run this script, i want older data(for ex: data beyond 1 month) should move to another db who's size is 100gb and append this data there
Posted

As far as I know there's no general script for archiving since the rules for archival process vary depending on the business rules of the database.

The amounts of data (10 GB and 100 GB) sound very small in overall so have to ask, why archiving? If the reason is performance, I'd suggest going through indexing of the database instead splitting the data into two separate databases (which introduces extra complexity). Depending on the edition you use I'd even consider partitioning if indexing doesn't yield sufficient results: Partitioned Tables and Indexes[^]
 
Share this answer
 
You can look at the transaction log file.
You can back it up and create a new one (shrink existing one).

Try - Manage the Size of the Transaction Log File[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900