Click here to Skip to main content
15,887,355 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to archive transaction data older than 3 months and move those data to Archival DB via Stored Procedure ? I am using SQL server 2005.
Posted
Updated 10-Jun-14 23:40pm
v2
Comments
Herman<T>.Instance 11-Jun-14 5:21am    
What have you tried?
syed shanu 12-Jun-14 1:03am    
To get the last three month transaction you try like this below query :
Declare @ThreeMonth_Before datetime=DateAdd(mm,-3,getdate())

select *
from YOURTABLE_NAME
where
YOUTRANSACTION_DATE >=@ThreeMonth_Before

here i get three month below date from current date and check in table where the transactiondate is greater then before 3 month.this will result 3 month all data from your table.

Now create a insert query with this select and inrest the result to your tables .
Make a SP and paste your query and execute it.
TheSqlGuy 20-Jun-14 22:58pm    
Are you referring to transaction logs? If so, have you tried log shipping? Please let me know.

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