Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a database in SQL Server 2014 and want to archive it and delete the original database data and import NEW data and I want to "restore" the archive just to view the dta, I want arcive the data every 3 month (the above explained procedure). In vb net is it possible?
Posted

1 solution

First of all I'm not sure that archiving is the best solution. The feasibility depends on why you're doing this. If it's because of performance reasons, I would strongly suggest searching other alternatives and optimizing the database and it's usage.

What comes to archiving, you have multiple choices. You can:

  • copy the data elsewhere using replication
  • detach the database, make a copy elsewhere and reattach, the detached database can be used as a separate database.
  • use SSIS to create data copy jobs etc


Of course you could also write a VB program to do at least part of the job, but I'd use SQL Server capability as much as possible.
 
Share this answer
 
Comments
Member 3892343 30-Jul-15 1:51am    
It is storage issue I store and archiving text and photos in the database soon I will exceed the storage limit of SQL per database, I want to archive the records every 6 months (about 2 GB per 6 months) and recall them when needed, I have hear of olap technology but cant find any tutorial and I want to do it by vb or c# .Net
Wendelius 30-Jul-15 3:24am    
First of all 2 GB doesn't sound so much, SQL Server can handle a lot more. Are you using Express or what is the limitation?

As far as I can see, OLAP isn't any solution in this kind of case, it's targeted for data warehouse reporting.

Member 3892343 30-Jul-15 6:04am    
use Express 4 gb limit i think, found some code to archive but don't have it here am at Office, nevertheless is there any code tutorial? this I found is not so clear.
Wendelius 30-Jul-15 7:02am    
I'm not sure which tutorial you're after. In your situation I'd probably use detach/attach scenario. This way I could have a separate database for example for each half a year. THe procedure would be something like
- detach database
- make a copy of it
- attach the database back
- attach the copy as a different database
- remove rows from original database.

An alternative would be to create a new database and just insert into..select from for each table to make an archive to another database

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